<template>
  <div>
    <!-- <div class="form-container-top">
        <div style="position: absolute; top: 20%; left: 10%; font-size: 30px;letter-spacing: 5px; font-weight: bolder;">陕西省水利专家申请系统</div>
       </div> -->
    <div class="information-form">
      <div v-if="showAdv" class="adv">
        系统通知:填报系统已关闭！

    </div>
      <div class="header">
        <span>信息填报&nbsp;<i class="el-icon-arrow-right"></i></span>
        <span style="font-size: 1vw"
          >欢迎：{{ expertname
          }}<button class="exit-btn" @click="exit">退出登录</button></span
        >
      </div>
      <div class="down" v-loading="loading">
        <div class="flag" v-if="!formLabelAlign.fillStatus">
          当前状态：待提交
        </div>
        <div
          class="flag"
          v-if="formLabelAlign.fillStatus"
          style="color: #0ca742"
        >
          当前状态：已提交
        </div>
        <el-tabs
          type="border-card"
          v-model="activeName"
          @tab-click="handleClickeltab"
          class="tabscard"
        >
          <!-- :before-leave="beforeLeaveTab" -->

          <el-tab-pane label="基本信息" name="first">
            <el-form :model="formLabelAlign" :rules="rules" ref="formRef">
              <div class="basic">
                <div class="one">
                  <div class="one-top">个人信息</div>
                  <div class="one-down">
                    <div class="left">
                      <el-upload
                        class="avatar-uploader"
                        :show-file-list="false"
                        action=""
                        :on-success="handleAvatarSuccess"
                        :on-change="handleChange"
                        :auto-upload="false"
                        :before-upload="beforeUploadimg"
                        prop="formLabelAlign.photoUrl"
                      >
                        <img v-if="Photo" :src="Photo" class="avatar" />
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                      </el-upload>
                      <div>
                        <span>一寸近期免冠彩照</span
                        ><br />仅支持jpg或jpeg格式建议大小不超过4M
                      </div>
                    </div>

                    <div class="right">
                      <!-- <el-form :model="formLabelAlign"   > -->
                      <div class="rightline">
                        <span style="">
                          <el-form-item
                            label="姓名"
                            class="custom-label"
                            prop="name"
                          >
                            <el-input
                              style="width: 9vw"
                              v-model="formLabelAlign.name"
                            ></el-input> </el-form-item
                        ></span>
                        <span>
                          <el-form-item
                            label="性别"
                            class="custom-label"
                            prop="gender"
                          >
                            <!-- <el-input v-model="formLabelAlign.sex"></el-input> -->
                            <el-select
                              v-model="formLabelAlign.gender"
                              placeholder="请选择"
                              style="width: 9vw"
                            >
                              <el-option
                                v-for="item in sexs"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                              >
                              </el-option>
                            </el-select> </el-form-item
                        ></span>
                        <span>
                          <el-form-item
                            label="民族"
                            class="custom-label"
                            prop="ethnicity"
                          >
                            <el-input
                              style="width: 9vw"
                              v-model="formLabelAlign.ethnicity"
                            ></el-input> </el-form-item
                        ></span>
                        <span>
                          <el-form-item
                            label="出生年月"
                            class="custom-label"
                            prop="birthDate"
                          >
                            <!-- <el-input v-model="formLabelAlign.birthDate"></el-input> -->
                            <div class="block">
                              <el-date-picker
                                v-model="formLabelAlign.birthDate"
                                type="date"
                                placeholder="选择日期"
                                style="width: 8vw"
                                :picker-options="pickerOptions"
                              >
                              </el-date-picker>
                            </div> </el-form-item
                        ></span>
                        <span>
                          <el-form-item
                            label="身份证号"
                            class="custom-label"
                            prop="idCard"
                          >
                            <el-input
                              v-model="formLabelAlign.idCard"
                              style="width: 8vw"
                            ></el-input> </el-form-item
                        ></span>
                      </div>

                      <!-- <el-row>
  <el-col :span="5">  <el-form-item label="姓名" prop="name">
    <el-input v-model="formLabelAlign.name"></el-input>
  </el-form-item></el-col>
  <el-col :span="5"><div class="grid-content bg-purple"></div></el-col>
  <el-col :span="5"><div class="grid-content bg-purple"></div></el-col>
  <el-col :span="5"><div class="grid-content bg-purple"></div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple"></div></el-col>
</el-row> -->

                      <div class="rightline">
                        <span>
                          <el-form-item
                            label="籍贯"
                            class="custom-label"
                            prop="nativePlace"
                          >
                            <!-- <el-input v-model="formLabelAlign.place"></el-input> -->
                            <!-- <el-select v-model="formLabelAlign.place" placeholder="请选择">
                                                            <el-option v-for="item in citys" :key="item.value"
                                                                :label="item.label" :value="item.value">
                                                            </el-option>
                                                            
                                                        </el-select> <el-cascader
                                v-model="formLabelAlign.nativePlace"
                                :options="citys"
                                :props="{ expandTrigger: 'hover' }"
                                @change="handleChange"
                                style="display: inline-block; width: 70%"
                              ></el-cascader> -->
                            <el-cascader
                              v-model="formLabelAlign.nativePlace"
                              :options="citys"
                              :props="{ expandTrigger: 'hover' }"
                              style="display: inline-block; width: 9vw"
                            ></el-cascader> </el-form-item
                        ></span>
                        <span>
                          <el-form-item
                            label="政治面貌"
                            class="custom-label"
                            prop="politicalStatus"
                          >
                            <el-select
                              v-model="formLabelAlign.politicalStatus"
                              placeholder="请选择"
                              style="width: 8vw"
                            >
                              <el-option
                                v-for="item in polite"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                              >
                              </el-option>
                            </el-select> </el-form-item
                        ></span>
                        <span>
                          <el-form-item
                            label="健康状况"
                            class="custom-label"
                            prop="healthStatus"
                          >
                            <el-input
                              v-model="formLabelAlign.healthStatus"
                              style="width: 8vw"
                            ></el-input> </el-form-item
                        ></span>
                        <span>
                          <el-form-item
                            label="学历"
                            class="custom-label"
                            prop="education"
                          >
                            <el-select
                              v-model="formLabelAlign.education"
                              placeholder="请选择"
                              style="width: 9vw"
                            >
                              <el-option
                                v-for="item in education"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                              >
                              </el-option>
                            </el-select> </el-form-item
                        ></span>
                        <span>
                          <el-form-item
                            label="毕业院校"
                            class="custom-label"
                            prop="graduateSchool"
                          >
                            <el-input
                              v-model="formLabelAlign.graduateSchool"
                              style="width: 8vw"
                            ></el-input> </el-form-item
                        ></span>
                      </div>
                      <div class="rightline">
                        <span>
                          <el-form-item
                            label="工作单位"
                            class="custom-label"
                            prop="workUnit"
                          >
                            <el-input
                              v-model="formLabelAlign.workUnit"
                              style="width: 8vw"
                            ></el-input> </el-form-item
                        ></span>
                        <span>
                          <el-form-item
                            label="职务"
                            class="custom-label"
                            prop="job"
                          >
                            <el-input
                              v-model="formLabelAlign.job"
                              style="width: 9vw"
                            ></el-input> </el-form-item
                        ></span>
                        <span>
                          <el-form-item
                            label="职称"
                            class="custom-label"
                            prop="title"
                          >
                            <!-- <el-input v-model="formLabelAlign.titles"></el-input> -->
                            <el-select
                              v-model="formLabelAlign.title"
                              placeholder="请选择"
                              style="width: 9vw"
                            >
                              <el-option
                                v-for="item in titles"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                              >
                              </el-option>
                            </el-select> </el-form-item
                        ></span>
                        <span style="width: 40%">
                          <el-form-item
                            label="是否为在职人员"
                            class="custom-label"
                            prop="isPublicOfficial"
                            ><el-radio-group
                              v-model="formLabelAlign.isPublicOfficial"
                            >
                              <el-radio :label="true">是</el-radio>
                              <el-radio :label="false">否</el-radio>
                            </el-radio-group>
                          </el-form-item></span
                        >
                      </div>
                      <div class="rightline">
                        <span>
                          <el-form-item
                            label="手机"
                            class="custom-label"
                            prop="phone"
                          >
                            <el-input
                              style="width: 9vw"
                              v-model="formLabelAlign.phone"
                            ></el-input> </el-form-item
                        ></span>
                        <span>
                          <el-form-item
                            label="邮箱"
                            class="custom-label"
                            prop="email"
                          >
                            <el-input
                              style="width: 9vw"
                              v-model="formLabelAlign.email"
                            ></el-input> </el-form-item
                        ></span>
                        <span style="width: 60%">
                          <el-form-item
                            label="从事水利相关工作时间"
                            class="custom-label"
                            prop="workTime"
                          >
                            <el-input
                              v-model="formLabelAlign.workTime"
                              style="width: 8vw"
                            ></el-input
                            ><span
                              style="
                                font-size: 1vw;
                                color: black;
                                margin-left: 1%;
                              "
                              >年</span
                            >
                          </el-form-item></span
                        >
                      </div>
                      <div class="rightline">
                        <div class="bankname">
                          <span style="width: 44%">
                            <el-form-item
                              label="开户银行"
                              class="custom-label"
                              prop="bankName"
                            >
                              <el-input
                                style="width: 8vw"
                                v-model="formLabelAlign.bankName"
                              ></el-input></el-form-item
                          ></span>
                          <span style="width: 50%; margin-left: -15%">
                            <el-form-item
                              label="银行卡号"
                              class="custom-label"
                              prop="bankAccount"
                            >
                              <el-input
                                style="width: 15vw; margin-left: 1%"
                                v-model="formLabelAlign.bankAccount"
                              ></el-input> </el-form-item
                          ></span>
                        </div>
                      </div>
                      <!-- </el-form> -->
                    </div>
                  </div>
                </div>
                <div class="one">
                  <div class="one-top">专业</div>
                  <div style="margin-top: 1%">
                    <!-- <el-row>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple">
                                                <span>第一专业(主专业)</span><el-select v-model="major.first" placeholder="请选择">
                                                    <el-option v-for="item in options" :key="item.value"
                                                        :label="item.label" :value="item.value">
                                                    </el-option>
                                                </el-select>
                                            </div>
                                        </el-col>
                                        <el-col :span="4">
                                            <div class="grid-content bg-purple">
                                                <span>第二专业</span><el-select v-model="major.second" placeholder="请选择">
                                                    <el-option v-for="item in options" :key="item.value"
                                                        :label="item.label" :value="item.value">
                                                    </el-option>
                                                </el-select>
                                            </div>
                                        </el-col>
                                        <el-col :span="4">
                                            <div class="grid-content bg-purple"></div>
                                        </el-col>
                                        <el-col :span="4">
                                            <div class="grid-content bg-purple"></div>
                                        </el-col>
                                        <el-col :span="4">
                                            <div class="grid-content bg-purple"></div>
                                        </el-col>
                                    </el-row>
                                 -->
                    <div class="secondline">
                      <!-- <div class="secondleft">
                        <el-form-item
                              label="第一专业(主专业)"
                              class="custom-label"
                              prop="primaryMajor"
                            >
                            <el-select
                          v-model="formLabelAlign.primaryMajor"
                          placeholder="请选择"
                        >
                          <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                          >
                          </el-option>
                        </el-select>
                          
                          </el-form-item>

                      </div> -->
                      <div class="secondright">
                        <span style="width: 22%">
                          <!-- <el-cascader
    v-model="value"
    :options="options1"
    @change="handleChange"></el-cascader> -->
                          <el-form-item
                            label="第一专业(主专业)"
                            class="custom-label"
                            prop="primaryMajor"
                          >
                            <!-- <el-select
                              v-model="formLabelAlign.primaryMajor"
                              placeholder="请选择"
                              @change="selectchange(0)"
                            >

                              <el-option
                                v-for="item in options1"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                              >
                              </el-option> -->
                            <!-- </el-select> -->
                            <el-cascader
                              style="width: 9vw"
                              v-model="formLabelAlign.primaryMajor"
                              :options="options1"
                              @change="selectchange(0)"
                            ></el-cascader>
                          </el-form-item>
                          <span
                            v-show="showmajorerror[0] == 1"
                            class="flag"
                            style="
                              margin-top: -2%;
                              margin-left: 0.7%;
                              font-size: 0.8vw;
                              height: 5vh;
                            "
                          >
                            专业出现重复
                          </span>
                        </span>
                        <span style="width: 19%"
                          ><el-form-item
                            label="第二专业"
                            class="custom-label"
                            prop="secondMajor"
                          >
                            <el-cascader
                              style="width: 9vw"
                              v-model="formLabelAlign.secondMajor"
                              :options="options"
                              @change="selectchange(1)"
                            ></el-cascader>
                            <!-- <el-select
                              v-model="formLabelAlign.secondMajor"
                              placeholder="请选择"
                              @change="selectchange(1)"
                            >
                              <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                              >
                              </el-option>
                            </el-select> -->
                          </el-form-item>
                          <span
                            class="flag"
                            v-show="showmajorerror[1] == 1"
                            style="
                              margin-top: -2%;
                              margin-left: 0.7%;
                              font-size: 0.8vw;
                              height: 5vh;
                            "
                          >
                            专业出现重复
                          </span></span
                        >
                        <span
                          ><el-form-item
                            label="第三专业"
                            class="custom-label"
                            prop="thirdMajor"
                          >
                            <el-cascader
                              style="width: 9vw"
                              v-model="formLabelAlign.thirdMajor"
                              :options="options"
                              @change="selectchange(0)"
                            ></el-cascader>
                            <!-- <el-select
                              v-model="formLabelAlign.thirdMajor"
                              placeholder="请选择"
                              @change="selectchange(2)"
                            >
                              <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                              >
                              </el-option>
                            </el-select> -->
                          </el-form-item>
                          <span
                            class="flag"
                            v-show="showmajorerror[2] == 1"
                            style="
                              margin-top: -2%;
                              margin-left: 0.7%;
                              font-size: 0.8vw;
                              height: 5vh;
                            "
                          >
                            专业出现重复
                          </span></span
                        >
                        <span>
                          <el-form-item
                            label="第四专业"
                            class="custom-label"
                            prop="fourthMajor"
                          >
                            <!-- <el-select
                              v-model="formLabelAlign.fourthMajor"
                              placeholder="请选择"
                              @change="selectchange(3)"
                            >
                              <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                              >
                              </el-option>
                            </el-select> -->
                            <el-cascader
                              style="width: 9vw"
                              v-model="formLabelAlign.fourthMajor"
                              :options="options"
                              @change="selectchange(0)"
                            ></el-cascader>
                          </el-form-item>
                          <span
                            class="flag"
                            v-show="showmajorerror[3] == 1"
                            style="
                              margin-top: -2%;
                              margin-left: 0.7%;
                              font-size: 0.8vw;
                              height: 5vh;
                            "
                          >
                            专业出现重复
                          </span></span
                        >
                        <span
                          ><el-form-item
                            label="第五专业"
                            class="custom-label"
                            prop="fifthMajor"
                          >
                            <el-cascader
                              style="width: 9vw"
                              v-model="formLabelAlign.fifthMajor"
                              :options="options"
                              @change="selectchange(0)"
                            ></el-cascader>
                            <!-- <el-select
                              v-model="formLabelAlign.fifthMajor"
                              placeholder="请选择"
                              @change="selectchange(4)"
                            >
                              <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                              >
                              </el-option>
                            </el-select> -->
                          </el-form-item>
                          <span
                            class="flag"
                            v-show="showmajorerror[4] == 1"
                            style="
                              margin-top: -2%;
                              margin-left: 0.7%;
                              font-size: 0.8vw;
                              height: 5vh;
                            "
                          >
                            专业出现重复
                          </span></span
                        >
                        <!-- <span style="width:20%;margin:0">
                         
                          </span>
                          <span  style="width:20%">
                          
                          </span>
                          <span  style="width:20%">
                          
                          </span>
                          <span  style="width:20%">
                         
                          </span>
                          <span  style="width:20%;margin:0">
                          
                          </span> -->
                      </div>
                    </div>
                  </div>
                </div>
                <div class="one">
                  <div class="one-top">其他</div>
                  <div class="downn">
                    <div class="downother">
                      <div>
                        <el-form-item
                          label="国家注册执业资格："
                          class="custom-label"
                          prop="registeredQualification"
                        >
                          <el-input
                            v-model="formLabelAlign.registeredQualification"
                            style="width: 30vw"
                          ></el-input>
                        </el-form-item>
                      </div>
                      <div
                        style="
                          width: 50%;
                          font-size: 0.8vw;
                          margin-left: 2%;
                          line-height: 1.5;
                          color: blue;
                        "
                      >
                        填写说明：无，填“无”，有多个，填写资格名称，并用"；"隔开，如：“注册土木工程师（水利水电工程）；注册电气工程师；注册消防工程师”
                      </div>
                    </div>
                    <div>
                      <div
                        class="downother1"
                        style="width: 100%; font-size: 2vw; margin-left: 0.5%"
                      >
                        <el-form-item
                          label="是否为院士"
                          class="custom-label"
                          prop="isAcademic"
                          style="width: 35%"
                        >
                          <el-radio-group
                            v-model="formLabelAlign.isAcademic"
                            style="margin-top: 12%"
                          >
                            <el-radio
                              style="display: inline-block"
                              :label="true"
                              >是</el-radio
                            >
                            <el-radio :label="false">否</el-radio>
                          </el-radio-group>
                        </el-form-item>
                        <el-form-item
                          label="是否为全国或省级工程勘察设计大师（水利）"
                          class="custom-label"
                          prop="isDesignMaster"
                          style="width: 40%"
                        >
                          <el-radio-group
                            v-model="formLabelAlign.isDesignMaster"
                            style="margin-top: 12%"
                          >
                            <el-radio
                              style="display: inline-block"
                              :label="true"
                              >是</el-radio
                            >
                            <el-radio :label="false">否</el-radio>
                          </el-radio-group>
                        </el-form-item>
                      </div>
                    </div>
                    <div style="margin-top: 1%">
                      <div
                        class="downother1"
                        style="width: 100%; font-size: 2vw"
                      >
                        <el-form-item
                          style="width: 35%"
                          label="是否为享受国务院政府特殊津贴的专家"
                          class="custom-label"
                          prop="isSubsidy"
                        >
                          <el-radio-group
                            v-model="formLabelAlign.isSubsidy"
                            style="margin-top: 12%"
                          >
                            <el-radio
                              style="display: inline-block"
                              :label="true"
                              >是</el-radio
                            >
                            <el-radio :label="false">否</el-radio>
                          </el-radio-group>
                        </el-form-item>
                        <el-form-item
                          label="是否为人才紧缺的特殊专业、特殊领域技术人才"
                          class="custom-label"
                          prop="isSubsidy"
                          style="width: 40%"
                        >
                          <el-radio-group
                            v-model="formLabelAlign.isSpecial"
                            style="margin-top: 12%"
                          >
                            <el-radio
                              style="display: inline-block"
                              :label="true"
                              >是</el-radio
                            >
                            <el-radio :label="false">否</el-radio>
                          </el-radio-group>
                        </el-form-item>
                      </div>
                    </div>
                  </div>
                </div>
                <div style="margin-bottom: 3%">
                  <!-- <el-button
                    :disabled="formLabelAlign.fillStatus"
                    style="font-size: 1vw; margin-left: 45%"
                    @click="saveone(0)"
                    >保存</el-button
                  >
                  <el-button
                    :disabled="formLabelAlign.fillStatus"
                    style="font-size: 1vw; margin-left: 5%"
                    @click="nextone"
                    >下一步</el-button
                  > -->
                </div>
              </div>
            </el-form>
          </el-tab-pane>
          <el-tab-pane label="工作履历" name="second">
            <div class="basic">
              <div class="one">
                <div class="one-top">
                  <span style="color: #f16f6d; margin-right: 1%">*</span
                  >主要工作经历
                </div>
                <div
                  class="one-down"
                  style="flex-direction: column; margin-top: 1%"
                >
                  <div>
                    <!-- <el-button @click="addRow">新增行</el-button>
                                        <el-button @click="deleteRow" :disabled="tableData.length <= 0">删除</el-button>
                                     -->
                    <!-- <el-button @click="addRow">新增行</el-button>
                    <el-button
                      @click="deleteSelectedRows"
                      :disabled="selectedRows.length === 0"
                      >删除选中的行</el-button
                    > -->
                    <!-- showworkfalse -->
                    <span
                      v-if="
                        tableData.length === 0 || tableData[0].position == ''
                      "
                      style="color: red; font-size: 1vw"
                      >请输入主要工作经历</span
                    >
                    <!-- <span v-if="showworkfalse" style='color:red'>请输入主要工作经历</span> -->
                  </div>
                  <div style="margin-top: 1%">
                    <el-table
                      :data="tableData"
                      style="width: 80vw"
                      @selection-change="handleSelectionChange"
                    >
                      <!-- 多选框 -->
                      <el-table-column
                        type="selection"
                        width="55"
                      ></el-table-column>

                      <!-- 序号列 -->
                      <el-table-column label="序号" width="100">
                        <template slot-scope="scope">{{
                          scope.$index + 1
                        }}</template>
                      </el-table-column>

                      <!-- 工作单位 -->
                      <el-table-column label="工作单位" width="300">
                        <template slot-scope="scope">
                          <el-input v-model="scope.row.orgName"></el-input>
                        </template>
                      </el-table-column>

                      <!-- 起止时间 -->
                      <el-table-column label="开始时间" width="250">
                        <template slot-scope="scope">
                          <!-- <el-input v-model="scope.row.startDate"></el-input> -->
                          <!-- <el-date-picker
                            v-model="scope.row.startDate"
                            type="date"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期"
                            :picker-options="pickerOptions1"
                          >
                          </el-date-picker> -->
                          <el-date-picker
                            v-model="scope.row.startDate"
                            align="right"
                            type="date"
                            placeholder="选择日期"
                          >
                          </el-date-picker>
                          <!-- <el-date-picker
      v-model="scope.row.startDate"
      type="date"
      :picker-options="pickerOptions1"
      placeholder="请选择">
    </el-date-picker> -->
                        </template>
                      </el-table-column>
                      <el-table-column label="结束时间" width="250">
                        <template slot-scope="scope">
                          <!-- <el-input v-model="scope.row.startDate"></el-input> -->
                          <!-- <el-date-picker
                            v-model="scope.row.startDate"
                            type="date"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期"
                            :picker-options="pickerOptions1"
                          >
                          </el-date-picker> -->
                          <div v-if="isTillNow[scope.$index]">
                            <span @click="showDatePicker(scope)">至今</span>
                          </div>
                          <div v-else>
                            <el-date-picker
                              v-model="scope.row.endDate"
                              type="date"
                              :picker-options="
                                getPickerOptions(scope.row, scope.$index)
                              "
                              placeholder="请选择"
                              @change="onDateChange(scope)"
                            >
                            </el-date-picker>
                          </div>
                        </template>
                      </el-table-column>
                      <!-- <el-table-column label="结束时间" width="250">
                        <template slot-scope="scope">
                          <span @click='gettoday(scope.row)'>至今</span>
                        </template>
                      </el-table-column> -->
                      <!-- 职称 -->
                      <el-table-column label="职称" width="260">
                        <template slot-scope="scope">
                          <el-input v-model="scope.row.title"></el-input>
                        </template>
                      </el-table-column>

                      <!-- 职务 -->
                      <el-table-column label="职务" width="260">
                        <template slot-scope="scope">
                          <el-input v-model="scope.row.position"></el-input>
                        </template>
                      </el-table-column>
                    </el-table>
                  </div>
                </div>
              </div>
              <div class="one">
                <div class="one-top">社会兼、聘职情况</div>
                <div
                  class="one-down"
                  style="flex-direction: column; margin-top: 1%"
                >
                  <div>
                    <!-- <el-button @click="addRow">新增行</el-button>
    <el-button @click="deleteRow" :disabled="tableData.length <= 0">删除</el-button>
 -->
                    <!-- <el-button @click="addRow1">新增行</el-button>
                    <el-button
                      @click="deleteSelectedRows1"
                      :disabled="selectedRows1.length === 0"
                      >删除选中的行</el-button
                    > -->
                  </div>
                  <div style="margin-top: 1%">
                    <el-table
                      :data="tableData1"
                      style="width: 100%"
                      @selection-change="handleSelectionChange1"
                    >
                      <!-- 多选框 -->
                      <el-table-column
                        type="selection"
                        width="55"
                      ></el-table-column>

                      <!-- 序号列 -->
                      <el-table-column label="序号" width="100">
                        <template slot-scope="scope">{{
                          scope.$index + 1
                        }}</template>
                      </el-table-column>
                      <!-- 工作单位 -->
                      <el-table-column label="兼职单位" width="300">
                        <template slot-scope="scope">
                          <el-input v-model="scope.row.orgName"></el-input>
                        </template>
                      </el-table-column>

                      <!-- 起止时间 -->
                      <el-table-column label="开始时间" width="250">
                        <template slot-scope="scope">
                          <!-- <el-input v-model="scope.row.startDate"></el-input> -->
                          <!-- <el-date-picker
                            v-model="scope.row.startDate"
                            type="date"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期"
                            :picker-options="pickerOptions1"
                          >
                          </el-date-picker> -->
                          <el-date-picker
                            v-model="scope.row.startDate"
                            align="right"
                            type="date"
                            placeholder="选择日期"
                          >
                          </el-date-picker>
                          <!-- <el-date-picker
      v-model="scope.row.startDate"
      type="date"
      :picker-options="pickerOptions1"
      placeholder="请选择">
    </el-date-picker> -->
                        </template>
                      </el-table-column>
                      <!-- <el-table-column label="结束时间" width="250">
                        <template slot-scope="scope"> -->
                      <!-- <el-input v-model="scope.row.startDate"></el-input> -->
                      <!-- <el-date-picker
                            v-model="scope.row.startDate"
                            type="date"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期"
                            :picker-options="pickerOptions1"
                          >
                          </el-date-picker> -->
                      <!-- <el-date-picker
      v-model="scope.row.endDate"
      type="date"
      placeholder="请选择">
    </el-date-picker>
                        </template>
                      </el-table-column> -->
                      <el-table-column label="结束时间" width="250">
                        <template slot-scope="scope">
                          <!-- <el-input v-model="scope.row.startDate"></el-input> -->
                          <!-- <el-date-picker
                            v-model="scope.row.startDate"
                            type="date"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期"
                            :picker-options="pickerOptions1"
                          >
                          </el-date-picker> -->
                          <div v-if="isTillNow1[scope.$index]">
                            <span @click="showDatePicker1(scope)">至今</span>
                          </div>
                          <div v-else>
                            <el-date-picker
                              v-model="scope.row.endDate"
                              type="date"
                              :picker-options="
                                getPickerOptions1(scope.row, scope.$index)
                              "
                              placeholder="请选择"
                              @change="onDateChange1(scope)"
                            >
                            </el-date-picker>
                          </div>
                        </template>
                      </el-table-column>
                      <!-- 兼职身份 -->
                      <el-table-column label="兼职身份" width="300">
                        <template slot-scope="scope">
                          <el-input v-model="scope.row.role"></el-input>
                        </template>
                      </el-table-column>
                    </el-table>
                  </div>
                </div>
              </div>
              <div class="one">
                <div class="one-top">
                  <span style="color: #f16f6d; margin-right: 1%">*</span>其他
                </div>
                <el-form :model="other" :rules="rules1" ref="other">
                  <el-form-item prop="researchResults">
                    <div
                      style="
                        margin-top: 1%;
                        color: black;
                        font-size: 1vw;
                        display: flex;
                        flex-direction: column;
                      "
                    >
                      <div style="display: flex; flex-direction: row">
                        <div style="width: 15vw; height: 100%">
                          <span>本人专业领域研究及成果：</span>
                        </div>
                        <div style="width: 85vw; height: 100%">
                          <el-input
                            type="textarea"
                            width="80%"
                            :rows="5"
                            placeholder="(包括课题、著作、奖励等，不超过800字)"
                            v-model="other.researchResults"
                          >
                          </el-input>
                        </div>
                      </div>
                    </div>
                  </el-form-item>
                  <el-form-item prop="projectConsultation">
                    <div
                      style="
                        margin-top: 1%;
                        color: black;
                        font-size: 1vw;
                        display: flex;
                        flex-direction: column;
                      "
                    >
                      <div style="display: flex; flex-direction: row">
                        <div style="width: 15vw; height: 100%">
                          <span>本人参加过何种项目咨询、审查、论证等事项:</span>
                        </div>
                        <div style="width: 85vw; height: 100%">
                          <el-input
                            type="textarea"
                            width="80%"
                            :rows="5"
                            placeholder="(包括课题、著作、奖励等，不超过800字)"
                            prop="projectConsultation"
                            v-model="other.projectConsultation"
                          >
                          </el-input>
                        </div>
                      </div>
                    </div>
                  </el-form-item>
                </el-form>
              </div>
              <div style="margin-top: 3%; margin-bottom: 3%">
                <!-- <el-button
                  style="font-size: 1vw; margin-left: 40%"
                  @click="backone"
                  >上一步</el-button
                >
                <el-button
                  :disabled="formLabelAlign.fillStatus"
                  style="font-size: 1vw; margin-left: 5%"
                  @click="savetwo(0)"
                  >保存</el-button
                >
                <el-button
                  :disabled="formLabelAlign.fillStatus"
                  style="font-size: 1vw; margin-left: 5%"
                  @click="nexttwo"
                  >下一步</el-button
                > -->
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="附件上传" name="third">
            <div class="basic">
              <div class="one">
                <div class="one-top">附件上传</div>
                <div class="downn">
                  <div style="font-size: 1vw">
                    <span>
                      <span style="color: #f16f6d; width: 1px; margin-right: 3%"
                        >*</span
                      >身份证正反面：</span
                    >
                    <!-- <el-upload
                      class="upload-demo uploads"
                      action=""
                      :headers="headers"
                      :auto-upload="false"
                      :on-success="successsubmit"
                      :limit="1"
                      :on-change="handleFileChange('idCard')"
                      :file-list="fileone"
                      :show-file-list="false"
                      :on-remove="
                        (file, fileList) => onremove(file, fileList, 1)
                      "
                    >
                      <el-button size="small" type="primary"
                        >点击上传</el-button
                      >
                      <div
                        slot="tip"
                        v-show="fileshow[0]"
                        class="el-upload__tip"
                        style="margin-left: 2%"
                      >
                        只能上传pdf文件，且不超过5MB
                      </div>
                    </el-upload> -->

                    <!-- <el-button
                      style="height: 80%"
                      size="small"
                      @click="remove('idCard')"
                      >清除文件</el-button
                    > -->
                    <el-button
                      style="height: 80%"
                      size="small"
                      @click="findanli('idCard')"
                      >查看案例</el-button
                    >
                  </div>
                  <div
                    v-if="!FOne.name"
                    style="
                      font-size: 1vw;
                      margin-left: 32%;
                      margin-top: -1%;
                      color: red;
                      /* cursor: pointer; */
                    "
                    @click="download(1)"
                  >
                    文件未上传
                  </div>
                  <div
                    v-if="FOne.name"
                    style="
                      font-size: 1vw;
                      margin-left: 32%;
                      margin-top: -1%;
                      color: blue;
                      cursor: pointer;
                    "
                    @click="download(1)"
                  >
                    点击预览：
                    {{ FOne.name }}
                  </div>
                  <div style="font-size: 1vw">
                    <span
                      ><span
                        style="color: #f16f6d; width: 1px; margin-right: 3%"
                        >*</span
                      >最高学历（学位）证书及技术职称：</span
                    >
                    <!-- <el-upload
                      class="upload-demo uploads"
                      action=""
                      :headers="headers"
                      :on-success="successsubmit"
                      :auto-upload="false"
                      :limit="1"
                      :on-change="handleFileChange('certificate')"
                      :file-list="filetwo"
                      :show-file-list="false"
                      :on-remove="
                        (file, fileList) => onremove(file, fileList, 2)
                      "
                    >
                      <el-button size="small" type="primary"
                        >点击上传</el-button
                      >
                      <div
                        slot="tip"
                        v-show="fileshow[1]"
                        class="el-upload__tip"
                        style="margin-left: 2%"
                      >
                        只能上传pdf文件，且不超过10MB
                      </div>
                    </el-upload> -->
                    <!-- <el-button
                      style="height: 80%"
                      size="small"
                      @click="remove('certificate')"
                      >清除文件</el-button
                    > -->
                    <el-button
                      style="height: 80%"
                      size="small"
                      @click="findanli('certificate')"
                      >查看案例</el-button
                    >
                  </div>
                  <div
                    v-if="!FTwo.name"
                    style="
                      font-size: 1vw;
                      margin-left: 32%;
                      margin-top: -1%;
                      color: red;
                      /* cursor: pointer; */
                    "
                    @click="download(1)"
                  >
                    文件未上传
                  </div>
                  <div
                    v-if="FTwo.name"
                    style="
                      font-size: 1vw;
                      margin-left: 32%;
                      margin-top: -1%;
                      color: blue;
                      cursor: pointer;
                    "
                    @click="download(2)"
                  >
                    点击预览：
                    {{ FTwo.name }}
                  </div>
                  <div style="font-size: 1vw">
                    <span
                      ><span
                        style="color: #f16f6d; width: 1px; margin-right: 3%"
                      ></span
                      >职业资格：</span
                    >
                    <!-- <el-upload
                      class="upload-demo uploads"
                      action=""
                      :on-success="successsubmit"
                      :headers="headers"
                      :auto-upload="false"
                      :limit="1"
                      :show-file-list="false"
                      :on-change="handleFileChange('qualification')"
                      :file-list="filethree"
                      :on-remove="
                        (file, fileList) => onremove(file, fileList, 3)
                      "
                    >
                      <el-button size="small" type="primary"
                        >点击上传</el-button
                      >
                      <div
                        slot="tip"
                        v-show="fileshow[2]"
                        class="el-upload__tip"
                        style="margin-left: 2%"
                      >
                        只能上传pdf文件，且不超过10MB
                      </div>
                    </el-upload> -->
                    <!-- <el-button
                      style="height: 80%"
                      size="small"
                      @click="remove('qualification')"
                      >清除文件</el-button
                    > -->
                    <el-button
                      style="height: 80%"
                      size="small"
                      @click="findanli('qualification')"
                      >查看案例</el-button
                    >
                  </div>
                  <div
                    v-if="!FThree.name"
                    style="
                      font-size: 1vw;
                      margin-left: 32%;
                      margin-top: -1%;
                      color: red;
                      /* cursor: pointer; */
                    "
                    @click="download(1)"
                  >
                    文件未上传
                  </div>
                  <div
                    v-if="FThree.name"
                    style="
                      font-size: 1vw;
                      margin-left: 32%;
                      margin-top: -1%;
                      color: blue;
                      cursor: pointer;
                    "
                    @click="download(3)"
                  >
                    点击预览：
                    {{ FThree.name }}
                  </div>
                  <div style="font-size: 1vw">
                    <span
                      ><span
                        style="color: #f16f6d; width: 1px; margin-right: 3%"
                        >*</span
                      >个人研究成果、工作成就、参与评审项目等相关证明材料：</span
                    >
                    <!-- <el-upload
                      class="upload-demo uploads"
                      action=""
                      :headers="headers"
                      :on-success="successsubmit"
                      :auto-upload="false"
                      :limit="1"
                      :on-change="handleFileChange('supportMater')"
                      :show-file-list="false"
                      :file-list="filefour"
                      :on-remove="
                        (file, fileList) => onremove(file, fileList, 4)
                      "
                    >
                      <el-button size="small" type="primary"
                        >点击上传</el-button
                      >
                      <div
                        slot="tip"
                        v-show="fileshow[3]"
                        class="el-upload__tip"
                        style="margin-left: 3%"
                      >
                        只能上传pdf文件，且不超过25MB
                      </div>
                    </el-upload> -->
                    <!-- <el-button
                      style="height: 80%"
                      size="small"
                      @click="remove('supportMater')"
                      >清除文件</el-button
                    > -->
                    <el-button
                      style="height: 80%"
                      size="small"
                      @click="findanli('supportMater')"
                      >查看案例</el-button
                    >
                  </div>
                  <div
                    v-if="!FFour.name"
                    style="
                      font-size: 1vw;
                      margin-left: 32%;
                      margin-top: -1%;
                      color: red;
                      /* cursor: pointer; */
                    "
                    @click="download(1)"
                  >
                    文件未上传
                  </div>
                  <div
                    v-if="FFour.name"
                    style="
                      font-size: 1vw;
                      margin-left: 32%;
                      margin-top: -1%;
                      color: blue;
                      cursor: pointer;
                    "
                    @click="download(4)"
                  >
                    点击预览：
                    {{ FFour.name }}
                  </div>
                  <div style="font-size: 1vw">
                    <span
                      ><span
                        style="color: #f16f6d; width: 1px; margin-right: 3%"
                        >*</span
                      >陕西省水利厅专家入库申请表(签字盖章)：</span
                    >
                    <!-- <el-upload
                      class="upload-demo uploads"
                      action=""
                      :headers="headers"
                      :on-success="successsubmit"
                      :auto-upload="false"
                      :show-file-list="false"
                      :limit="1"
                      :on-change="handleFileChange('applicationForm')"
                      :file-list="filefive"
                      :on-remove="
                        (file, fileList) => onremove(file, fileList, 5)
                      "
                    >
                      <el-button size="small" type="primary"
                        >点击上传</el-button
                      >
                      <div
                        slot="tip"
                        v-show="fileshow[4]"
                        class="el-upload__tip"
                        style="margin-left: 2%"
                      >
                        只能上传pdf文件，且不超过5MB
                      </div>
                    </el-upload> -->
                    <!-- <el-button
                      style="height: 80%"
                      size="small"
                      @click="remove('applicationForm')"
                      >清除文件</el-button
                    > -->
                    <el-button
                      style="height: 80%"
                      size="small"
                      @click="findanli('applicationForm')"
                      >查看案例</el-button
                    >
                  </div>
                  <div
                    v-if="!FFive.name"
                    style="
                      font-size: 1vw;
                      margin-left: 32%;
                      margin-top: -1%;
                      color: red;
                      /* cursor: pointer; */
                    "
                    @click="download(1)"
                  >
                    文件未上传
                  </div>
                  <div
                    v-if="FFive.name"
                    style="
                      font-size: 1vw;
                      margin-left: 32%;
                      margin-top: -1%;
                      color: blue;
                      cursor: pointer;
                    "
                    @click="download(5)"
                  >
                    点击预览：
                    {{ FFive.name }}
                  </div>
                </div>
              </div>
              <div style="margin-top: 5%; margin-bottom: 3%">
                <!-- <el-button
                  style="font-size: 1vw; margin-left: 35%"
                  @click="backtwo"
                  >上一步</el-button
                >
                <el-button
                  :disabled="formLabelAlign.fillStatus"
                  style="font-size: 1vw; margin-left: 5%"
                  @click="savethree"
                  >保存</el-button
                >
                <el-button
                  :disabled="formLabelAlign.fillStatus"
                  style="font-size: 1vw; margin-left: 5%"
                  @click="nextthree"
                  >提交</el-button
                > -->
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="信息审核" name="forth">
            <div class="basic">
              <div class="one" style="margin-bottom: 10%">
                <!-- 待审核   通过   未通过 -->
                <div
                  v-if="formLabelAlign.auditStatus == '待审核'"
                  class="one-top"
                >
                  信息审核:
                  <span style="color: yellow; margin-left: 1%">{{
                    this.formLabelAlign.auditStatus
                  }}</span>
                </div>
                <div
                  v-if="formLabelAlign.auditStatus == '通过'"
                  class="one-top"
                >
                  信息审核:
                  <span style="color: #0ca742; margin-left: 1%">{{
                    this.formLabelAlign.auditStatus
                  }}</span>
                </div>
                <div
                  v-if="formLabelAlign.auditStatus == '未通过'"
                  class="one-top"
                >
                  信息审核:
                  <span style="color: red; margin-left: 1%">{{
                    this.formLabelAlign.auditStatus
                  }}</span>
                </div>
                <!-- <div class="one-top">信息审核: {{ this.formLabelAlign.auditStatus }}</div>
                <div class="one-top">信息审核: {{ this.formLabelAlign.auditStatus }}</div>  -->
                <!-- <div class="one-top">信息审核: <span></span></div> -->
                <div class="one-down" style="width: 90%; margin-left: 5%">
                  <el-input
                    type="textarea"
                    :autosize="{ minRows: 20, maxRows: 2 }"  
                    placeholder="未审核，请耐心等待"                  
                    v-model="formLabelAlign.auditOpinion"
                    readonly
                  >
                  </el-input>
                </div>
              </div>
            </div>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>
<script>
import { Message } from "element-ui";
import http from "@/utils/request";

export default {
  data() {
    return {
      showAdv: true,
      isTillNow: [false], // 跟踪每一行是否选择了“至今”
      isTillNow1: [false], // 跟踪每一行是否选择了“至今”
      pickerOptions2: {
        shortcuts: [
          {
            text: "至今",
            onClick(picker) {
              // 使用箭头函数来保持 this 指向 Vue 实例
              console.log(1231233);
              this.scope.row.endDate = new Date(); // 直接设置 endDate 为当前日期
            },
          },
        ],
      },
      expertname: "",
      time: new Date().getFullYear() + "",
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now() - 8.64e7; // 8.64e7 毫秒数代表一年
        },
      },
      pickerOptions1: {
        // 禁用第二个日期选择器的日期为今天以后
        disabledDate(time) {
          return time > new Date(); // 禁止选择今天之后的日期
        },
      },
      value2: "",
      loading: false,
      citys: [
        {
          children: [
            {
              value: "石家庄市",
              label: "石家庄市",
            },
            {
              value: "邯郸市",
              label: "邯郸市",
            },
            {
              value: "唐山市",
              label: "唐山市",
            },
            {
              value: "保定市",
              label: "保定市",
            },
            {
              value: "秦皇岛市",
              label: "秦皇岛市",
            },
            {
              value: "邢台市",
              label: "邢台市",
            },
            {
              value: "张家口市",
              label: "张家口市",
            },
            {
              value: "承德市",
              label: "承德市",
            },
            {
              value: "沧州市",
              label: "沧州市",
            },
            {
              value: "廊坊市",
              label: "廊坊市",
            },
            {
              value: "衡水市",
              label: "衡水市",
            },
            {
              value: "辛集市",
              label: "辛集市",
            },
            {
              value: "晋州市",
              label: "晋州市",
            },
            {
              value: "新乐市",
              label: "新乐市",
            },
            {
              value: "遵化市",
              label: "遵化市",
            },
            {
              value: "迁安市",
              label: "迁安市",
            },
            {
              value: "霸州市",
              label: "霸州市",
            },
            {
              value: "三河市",
              label: "三河市",
            },
            {
              value: "定州市",
              label: "定州市",
            },
            {
              value: "涿州市",
              label: "涿州市",
            },
            {
              value: "安国市",
              label: "安国市",
            },
            {
              value: "高碑店市",
              label: "高碑店市",
            },
            {
              value: "泊头市",
              label: "泊头市",
            },
            {
              value: "任丘市",
              label: "任丘市",
            },
            {
              value: "黄骅市",
              label: "黄骅市",
            },
            {
              value: "河间市",
              label: "河间市",
            },
            {
              value: "冀州市",
              label: "冀州市",
            },
            {
              value: "深州市",
              label: "深州市",
            },
            {
              value: "南宫市",
              label: "南宫市",
            },
            {
              value: "沙河市",
              label: "沙河市",
            },
            {
              value: "武安市",
              label: "武安市",
            },
          ],
          value: "河北省",
          label: "河北省",
        },
        {
          children: [
            {
              value: "太原市",
              label: "太原市",
            },
            {
              value: "大同市",
              label: "大同市",
            },
            {
              value: "朔州市",
              label: "朔州市",
            },
            {
              value: "阳泉市",
              label: "阳泉市",
            },
            {
              value: "长治市",
              label: "长治市",
            },
            {
              value: "晋城市",
              label: "晋城市",
            },
            {
              value: "忻州市",
              label: "忻州市",
            },
            {
              value: "吕梁市",
              label: "吕梁市",
            },
            {
              value: "晋中市",
              label: "晋中市",
            },
            {
              value: "临汾市",
              label: "临汾市",
            },
            {
              value: "运城市",
              label: "运城市",
            },
            {
              value: "古交市",
              label: "古交市",
            },
            {
              value: "潞城市",
              label: "潞城市",
            },
            {
              value: "高平市",
              label: "高平市",
            },
            {
              value: "原平市",
              label: "原平市",
            },
            {
              value: "孝义市",
              label: "孝义市",
            },
            {
              value: "汾阳市",
              label: "汾阳市",
            },
            {
              value: "介休市",
              label: "介休市",
            },
            {
              value: "侯马市",
              label: "侯马市",
            },
            {
              value: "霍州市",
              label: "霍州市",
            },
            {
              value: "永济市",
              label: "永济市",
            },
            {
              value: "河津市",
              label: "河津市",
            },
          ],
          value: "山西省",
          label: "山西省",
        },
        {
          children: [
            {
              value: "呼和浩特市",
              label: "呼和浩特市",
            },
            {
              value: "包头市",
              label: "包头市",
            },
            {
              value: "乌海市",
              label: "乌海市",
            },
            {
              value: "赤峰市",
              label: "赤峰市",
            },
            {
              value: "呼伦贝尔市",
              label: "呼伦贝尔市",
            },
            {
              value: "通辽市",
              label: "通辽市",
            },
            {
              value: "乌兰察布市",
              label: "乌兰察布市",
            },
            {
              value: "鄂尔多斯市",
              label: "鄂尔多斯市",
            },
            {
              value: "巴彦淖尔市",
              label: "巴彦淖尔市",
            },
            {
              value: "满洲里市",
              label: "满洲里市",
            },
            {
              value: "扎兰屯市",
              label: "扎兰屯市",
            },
            {
              value: "牙克石市",
              label: "牙克石市",
            },
            {
              value: "根河市",
              label: "根河市",
            },
            {
              value: "额尔古纳市",
              label: "额尔古纳市",
            },
            {
              value: "乌兰浩特市",
              label: "乌兰浩特市",
            },
            {
              value: "阿尔山市",
              label: "阿尔山市",
            },
            {
              value: "霍林郭勒市",
              label: "霍林郭勒市",
            },
            {
              value: "锡林浩特市",
              label: "锡林浩特市",
            },
            {
              value: "二连浩特市",
              label: "二连浩特市",
            },
            {
              value: "丰镇市",
              label: "丰镇市",
            },
          ],
          value: "内蒙古自治区",
          label: "内蒙古自治区",
        },
        {
          children: [
            {
              value: "沈阳市",
              label: "沈阳市",
            },
            {
              value: "大连市",
              label: "大连市",
            },
            {
              value: "朝阳市",
              label: "朝阳市",
            },
            {
              value: "阜新市",
              label: "阜新市",
            },
            {
              value: "铁岭市",
              label: "铁岭市",
            },
            {
              value: "抚顺市",
              label: "抚顺市",
            },
            {
              value: "本溪市",
              label: "本溪市",
            },
            {
              value: "辽阳市",
              label: "辽阳市",
            },
            {
              value: "鞍山市",
              label: "鞍山市",
            },
            {
              value: "丹东市",
              label: "丹东市",
            },
            {
              value: "营口市",
              label: "营口市",
            },
            {
              value: "盘锦市",
              label: "盘锦市",
            },
            {
              value: "锦州市",
              label: "锦州市",
            },
            {
              value: "葫芦岛市",
              label: "葫芦岛市",
            },
            {
              value: "新民市",
              label: "新民市",
            },
            {
              value: "瓦房店市",
              label: "瓦房店市",
            },
            {
              value: "庄河市",
              label: "庄河市",
            },
            {
              value: "北票市",
              label: "北票市",
            },
            {
              value: "凌源市",
              label: "凌源市",
            },
            {
              value: "调兵山市",
              label: "调兵山市",
            },
            {
              value: "开原市",
              label: "开原市",
            },
            {
              value: "灯塔市",
              label: "灯塔市",
            },
            {
              value: "海城市",
              label: "海城市",
            },
            {
              value: "凤城市",
              label: "凤城市",
            },
            {
              value: "东港市",
              label: "东港市",
            },
            {
              value: "大石桥市",
              label: "大石桥市",
            },
            {
              value: "盖州市",
              label: "盖州市",
            },
            {
              value: "凌海市",
              label: "凌海市",
            },
            {
              value: "北镇市",
              label: "北镇市",
            },
            {
              value: "兴城市",
              label: "兴城市",
            },
          ],
          value: "辽宁省",
          label: "辽宁省",
        },
        {
          children: [
            {
              value: "长春市",
              label: "长春市",
            },
            {
              value: "吉林市",
              label: "吉林市",
            },
            {
              value: "白城市",
              label: "白城市",
            },
            {
              value: "松原市",
              label: "松原市",
            },
            {
              value: "四平市",
              label: "四平市",
            },
            {
              value: "辽源市",
              label: "辽源市",
            },
            {
              value: "通化市",
              label: "通化市",
            },
            {
              value: "白山市",
              label: "白山市",
            },
            {
              value: "德惠市",
              label: "德惠市",
            },
            {
              value: "榆树市",
              label: "榆树市",
            },
            {
              value: "磐石市",
              label: "磐石市",
            },
            {
              value: "蛟河市",
              label: "蛟河市",
            },
            {
              value: "桦甸市",
              label: "桦甸市",
            },
            {
              value: "舒兰市",
              label: "舒兰市",
            },
            {
              value: "洮南市",
              label: "洮南市",
            },
            {
              value: "大安市",
              label: "大安市",
            },
            {
              value: "双辽市",
              label: "双辽市",
            },
            {
              value: "公主岭市",
              label: "公主岭市",
            },
            {
              value: "梅河口市",
              label: "梅河口市",
            },
            {
              value: "集安市",
              label: "集安市",
            },
            {
              value: "临江市",
              label: "临江市",
            },
            {
              value: "延吉市",
              label: "延吉市",
            },
            {
              value: "图们市",
              label: "图们市",
            },
            {
              value: "敦化市",
              label: "敦化市",
            },
            {
              value: "珲春市",
              label: "珲春市",
            },
            {
              value: "龙井市",
              label: "龙井市",
            },
            {
              value: "和龙市",
              label: "和龙市",
            },
            {
              value: "扶余市",
              value: "扶余市",
            },
          ],
          value: "吉林省",
          label: "吉林省",
        },
        {
          children: [
            {
              value: "哈尔滨市",
              label: "哈尔滨市",
            },
            {
              value: "齐齐哈尔市",
              label: "齐齐哈尔市",
            },
            {
              value: "黑河市",
              label: "黑河市",
            },
            {
              value: "大庆市",
              label: "大庆市",
            },
            {
              value: "伊春市",
              label: "伊春市",
            },
            {
              value: "鹤岗市",
              label: "鹤岗市",
            },
            {
              value: "佳木斯市",
              label: "佳木斯市",
            },
            {
              value: "双鸭山市",
              label: "双鸭山市",
            },
            {
              value: "七台河市",
              label: "七台河市",
            },
            {
              value: "鸡西市",
              label: "鸡西市",
            },
            {
              value: "牡丹江市",
              label: "牡丹江市",
            },
            {
              value: "绥化市",
              label: "绥化市",
            },
            {
              value: "尚志市",
              label: "尚志市",
            },
            {
              value: "五常市",
              label: "五常市",
            },
            {
              value: "讷河市",
              label: "讷河市",
            },
            {
              value: "北安市",
              label: "北安市",
            },
            {
              value: "五大连池市",
              label: "五大连池市",
            },
            {
              value: "铁力市",
              label: "铁力市",
            },
            {
              value: "同江市",
              label: "同江市",
            },
            {
              value: "富锦市",
              label: "富锦市",
            },
            {
              value: "虎林市",
              label: "虎林市",
            },
            {
              value: "密山市",
              label: "密山市",
            },
            {
              value: "绥芬河市",
              label: "绥芬河市",
            },
            {
              value: "海林市",
              label: "海林市",
            },
            {
              value: "宁安市",
              label: "宁安市",
            },
            {
              value: "安达市",
              label: "安达市",
            },
            {
              value: "肇东市",
              label: "肇东市",
            },
            {
              value: "海伦市",
              label: "海伦市",
            },
            {
              value: "穆棱市",
              label: "穆棱市",
            },
            {
              value: "东宁市",
              label: "东宁市",
            },
            {
              value: "抚远市",
              label: "抚远市",
            },
          ],
          value: "黑龙江省",
          label: "黑龙江省",
        },
        {
          children: [
            {
              value: "南京市",
              label: "南京市",
            },
            {
              value: "徐州市",
              label: "徐州市",
            },
            {
              value: "连云港市",
              label: "连云港市",
            },
            {
              value: "宿迁市",
              label: "宿迁市",
            },
            {
              value: "淮安市",
              label: "淮安市",
            },
            {
              value: "盐城市",
              label: "盐城市",
            },
            {
              value: "扬州市",
              label: "扬州市",
            },
            {
              value: "泰州市",
              label: "泰州市",
            },
            {
              value: "南通市",
              label: "南通市",
            },
            {
              value: "镇江市",
              label: "镇江市",
            },
            {
              value: "常州市",
              label: "常州市",
            },
            {
              value: "无锡市",
              label: "无锡市",
            },
            {
              value: "苏州市",
              label: "苏州市",
            },
            {
              value: "常熟市",
              label: "常熟市",
            },
            {
              value: "张家港市",
              label: "张家港市",
            },
            {
              value: "太仓市",
              label: "太仓市",
            },
            {
              value: "昆山市",
              label: "昆山市",
            },
            {
              value: "江阴市",
              label: "江阴市",
            },
            {
              value: "宜兴市",
              label: "宜兴市",
            },
            {
              value: "溧阳市",
              label: "溧阳市",
            },
            {
              value: "扬中市",
              label: "扬中市",
            },
            {
              value: "句容市",
              label: "句容市",
            },
            {
              value: "丹阳市",
              label: "丹阳市",
            },
            {
              value: "如皋市",
              label: "如皋市",
            },
            {
              value: "海门市",
              label: "海门市",
            },
            {
              value: "启东市",
              label: "启东市",
            },
            {
              value: "高邮市",
              label: "高邮市",
            },
            {
              value: "仪征市",
              label: "仪征市",
            },
            {
              value: "兴化市",
              label: "兴化市",
            },
            {
              value: "泰兴市",
              label: "泰兴市",
            },
            {
              value: "靖江市",
              label: "靖江市",
            },
            {
              value: "东台市",
              label: "东台市",
            },
            {
              value: "邳州市",
              label: "邳州市",
            },
            {
              value: "新沂市",
              label: "新沂市",
            },
          ],
          value: "江苏省",
          label: "江苏省",
        },
        {
          children: [
            {
              value: "杭州市",
              label: "杭州市",
            },
            {
              value: "宁波市",
              label: "宁波市",
            },
            {
              value: "湖州市",
              label: "湖州市",
            },
            {
              value: "嘉兴市",
              label: "嘉兴市",
            },
            {
              value: "舟山市",
              label: "舟山市",
            },
            {
              value: "绍兴市",
              label: "绍兴市",
            },
            {
              value: "衢州市",
              label: "衢州市",
            },
            {
              value: "金华市",
              label: "金华市",
            },
            {
              value: "台州市",
              label: "台州市",
            },
            {
              value: "温州市",
              label: "温州市",
            },
            {
              value: "丽水市",
              label: "丽水市",
            },
            {
              value: "临安市",
              label: "临安市",
            },
            {
              value: "建德市",
              label: "建德市",
            },
            {
              value: "慈溪市",
              label: "慈溪市",
            },
            {
              value: "余姚市",
              label: "余姚市",
            },
            {
              value: "平湖市",
              label: "平湖市",
            },
            {
              value: "海宁市",
              label: "海宁市",
            },
            {
              value: "桐乡市",
              label: "桐乡市",
            },
            {
              value: "诸暨市",
              label: "诸暨市",
            },
            {
              value: "嵊州市",
              label: "嵊州市",
            },
            {
              value: "江山市",
              label: "江山市",
            },
            {
              value: "兰溪市",
              label: "兰溪市",
            },
            {
              value: "永康市",
              label: "永康市",
            },
            {
              value: "义乌市",
              label: "义乌市",
            },
            {
              value: "东阳市",
              label: "东阳市",
            },
            {
              value: "临海市",
              label: "临海市",
            },
            {
              value: "温岭市",
              label: "温岭市",
            },
            {
              value: "瑞安市",
              label: "瑞安市",
            },
            {
              value: "乐清市",
              label: "乐清市",
            },
            {
              value: "龙泉市",
              label: "龙泉市",
            },
          ],
          value: "浙江省",
          label: "浙江省",
        },
        {
          children: [
            {
              value: "合肥市",
              label: "合肥市",
            },
            {
              value: "芜湖市",
              label: "芜湖市",
            },
            {
              value: "蚌埠市",
              label: "蚌埠市",
            },
            {
              value: "淮南市",
              label: "淮南市",
            },
            {
              value: "马鞍山市",
              label: "马鞍山市",
            },
            {
              value: "淮北市",
              label: "淮北市",
            },
            {
              value: "铜陵市",
              label: "铜陵市",
            },
            {
              value: "安庆市",
              label: "安庆市",
            },
            {
              value: "黄山市",
              label: "黄山市",
            },
            {
              value: "滁州市",
              label: "滁州市",
            },
            {
              value: "阜阳市",
              label: "阜阳市",
            },
            {
              value: "宿州市",
              label: "宿州市",
            },
            {
              value: "六安市",
              label: "六安市",
            },
            {
              value: "亳州市",
              label: "亳州市",
            },
            {
              value: "池州市",
              label: "池州市",
            },
            {
              value: "宣城市",
              label: "宣城市",
            },
            {
              value: "巢湖市",
              label: "巢湖市",
            },
            {
              value: "桐城市",
              label: "桐城市",
            },
            {
              value: "天长市",
              label: "天长市",
            },
            {
              value: "明光市",
              label: "明光市",
            },
            {
              value: "界首市",
              label: "界首市",
            },
            {
              value: "宁国市",
              label: "宁国市",
            },
          ],
          value: "安徽省",
          label: "安徽省",
        },
        {
          children: [
            {
              value: "厦门市",
              label: "厦门市",
            },
            {
              value: "福州市",
              label: "福州市",
            },
            {
              value: "南平市",
              label: "南平市",
            },
            {
              value: "三明市",
              label: "三明市",
            },
            {
              value: "莆田市",
              label: "莆田市",
            },
            {
              value: "泉州市",
              label: "泉州市",
            },
            {
              value: "漳州市",
              label: "漳州市",
            },
            {
              value: "龙岩市",
              label: "龙岩市",
            },
            {
              value: "宁德市",
              label: "宁德市",
            },
            {
              value: "福清市",
              label: "福清市",
            },
            {
              value: "长乐市",
              label: "长乐市",
            },
            {
              value: "邵武市",
              label: "邵武市",
            },
            {
              value: "武夷山市",
              label: "武夷山市",
            },
            {
              value: "建瓯市",
              label: "建瓯市",
            },
            {
              value: "永安市",
              label: "永安市",
            },
            {
              value: "石狮市",
              label: "石狮市",
            },
            {
              value: "晋江市",
              label: "晋江市",
            },
            {
              value: "南安市",
              label: "南安市",
            },
            {
              value: "龙海市",
              label: "龙海市",
            },
            {
              value: "漳平市",
              label: "漳平市",
            },
            {
              value: "福安市",
              label: "福安市",
            },
            {
              value: "福鼎市",
              label: "福鼎市",
            },
          ],
          value: "福建省",
          label: "福建省",
        },
        {
          children: [
            {
              value: "南昌市",
              label: "南昌市",
            },
            {
              value: "九江市",
              label: "九江市",
            },
            {
              value: "景德镇市",
              label: "景德镇市",
            },
            {
              value: "鹰潭市",
              label: "鹰潭市",
            },
            {
              value: "新余市",
              label: "新余市",
            },
            {
              value: "萍乡市",
              label: "萍乡市",
            },
            {
              value: "赣州市",
              label: "赣州市",
            },
            {
              value: "上饶市",
              label: "上饶市",
            },
            {
              value: "抚州市",
              label: "抚州市",
            },
            {
              value: "宜春市",
              label: "宜春市",
            },
            {
              value: "吉安市",
              label: "吉安市",
            },
            {
              value: "瑞昌市",
              label: "瑞昌市",
            },
            {
              value: "共青城市",
              label: "共青城市",
            },
            {
              value: "乐平市",
              label: "乐平市",
            },
            {
              value: "瑞金市",
              label: "瑞金市",
            },
            {
              value: "德兴市",
              label: "德兴市",
            },
            {
              value: "丰城市",
              label: "丰城市",
            },
            {
              value: "樟树市",
              label: "樟树市",
            },
            {
              value: "高安市",
              label: "高安市",
            },
            {
              value: "井冈山市",
              label: "井冈山市",
            },
            {
              value: "贵溪市",
              label: "贵溪市",
            },
          ],
          value: "江西省",
          label: "江西省",
        },
        {
          children: [
            {
              value: "济南市",
              label: "济南市",
            },
            {
              value: "青岛市",
              label: "青岛市",
            },
            {
              value: "聊城市",
              label: "聊城市",
            },
            {
              value: "德州市",
              label: "德州市",
            },
            {
              value: "东营市",
              label: "东营市",
            },
            {
              value: "淄博市",
              label: "淄博市",
            },
            {
              value: "潍坊市",
              label: "潍坊市",
            },
            {
              value: "烟台市",
              label: "烟台市",
            },
            {
              value: "威海市",
              label: "威海市",
            },
            {
              value: "日照市",
              label: "日照市",
            },
            {
              value: "临沂市",
              label: "临沂市",
            },
            {
              value: "枣庄市",
              label: "枣庄市",
            },
            {
              value: "济宁市",
              label: "济宁市",
            },
            {
              value: "泰安市",
              label: "泰安市",
            },
            {
              value: "莱芜市",
              label: "莱芜市",
            },
            {
              value: "滨州市",
              label: "滨州市",
            },
            {
              value: "菏泽市",
              label: "菏泽市",
            },
            {
              value: "胶州市",
              label: "胶州市",
            },
            {
              value: "即墨市",
              label: "即墨市",
            },
            {
              value: "平度市",
              label: "平度市",
            },
            {
              value: "莱西市",
              label: "莱西市",
            },
            {
              value: "临清市",
              label: "临清市",
            },
            {
              value: "乐陵市",
              label: "乐陵市",
            },
            {
              value: "禹城市",
              label: "禹城市",
            },
            {
              value: "安丘市",
              label: "安丘市",
            },
            {
              value: "昌邑市",
              label: "昌邑市",
            },
            {
              value: "高密市",
              label: "高密市",
            },
            {
              value: "青州市",
              label: "青州市",
            },
            {
              value: "诸城市",
              label: "诸城市",
            },
            {
              value: "寿光市",
              label: "寿光市",
            },
            {
              value: "栖霞市",
              label: "栖霞市",
            },
            {
              value: "海阳市",
              label: "海阳市",
            },
            {
              value: "龙口市",
              label: "龙口市",
            },
            {
              value: "莱阳市",
              label: "莱阳市",
            },
            {
              value: "莱州市",
              label: "莱州市",
            },
            {
              value: "蓬莱市",
              label: "蓬莱市",
            },
            {
              value: "招远市",
              label: "招远市",
            },
            {
              value: "荣成市",
              label: "荣成市",
            },
            {
              value: "乳山市",
              label: "乳山市",
            },
            {
              value: "滕州市",
              label: "滕州市",
            },
            {
              value: "曲阜市",
              label: "曲阜市",
            },
            {
              value: "邹城市",
              label: "邹城市",
            },
            {
              value: "新泰市",
              label: "新泰市",
            },
            {
              value: "肥城市",
              label: "肥城市",
            },
          ],
          value: "山东省",
          label: "山东省",
        },
        {
          children: [
            {
              value: "郑州市",
              label: "郑州市",
            },
            {
              value: "开封市",
              label: "开封市",
            },
            {
              value: "洛阳市",
              label: "洛阳市",
            },
            {
              value: "平顶山市",
              label: "平顶山市",
            },
            {
              value: "安阳市",
              label: "安阳市",
            },
            {
              value: "鹤壁市",
              label: "鹤壁市",
            },
            {
              value: "新乡市",
              label: "新乡市",
            },
            {
              value: "焦作市",
              label: "焦作市",
            },
            {
              value: "濮阳市",
              label: "濮阳市",
            },
            {
              value: "许昌市",
              label: "许昌市",
            },
            {
              value: "漯河市",
              label: "漯河市",
            },
            {
              value: "三门峡市",
              label: "三门峡市",
            },
            {
              value: "南阳市",
              label: "南阳市",
            },
            {
              value: "商丘市",
              label: "商丘市",
            },
            {
              value: "周口市",
              label: "周口市",
            },
            {
              value: "驻马店市",
              label: "驻马店市",
            },
            {
              value: "信阳市",
              label: "信阳市",
            },
            {
              value: "荥阳市",
              label: "荥阳市",
            },
            {
              value: "新郑市",
              label: "新郑市",
            },
            {
              value: "登封市",
              label: "登封市",
            },
            {
              value: "新密市",
              label: "新密市",
            },
            {
              value: "偃师市",
              label: "偃师市",
            },
            {
              value: "孟州市",
              label: "孟州市",
            },
            {
              value: "沁阳市",
              label: "沁阳市",
            },
            {
              value: "卫辉市",
              label: "卫辉市",
            },
            {
              value: "辉县市",
              label: "辉县市",
            },
            {
              value: "林州市",
              label: "林州市",
            },
            {
              value: "禹州市",
              label: "禹州市",
            },
            {
              value: "长葛市",
              label: "长葛市",
            },
            {
              value: "舞钢市",
              label: "舞钢市",
            },
            {
              value: "义马市",
              label: "义马市",
            },
            {
              value: "灵宝市",
              label: "灵宝市",
            },
            {
              value: "项城市",
              label: "项城市",
            },
            {
              value: "巩义市",
              label: "巩义市",
            },
            {
              value: "邓州市",
              label: "邓州市",
            },
            {
              value: "永城市",
              label: "永城市",
            },
            {
              value: "汝州市",
              label: "汝州市",
            },
            {
              value: "济源市",
              label: "济源市",
            },
          ],
          value: "河南省",
          label: "河南省",
        },
        {
          children: [
            {
              value: "武汉市",
              label: "武汉市",
            },
            {
              value: "十堰市",
              label: "十堰市",
            },
            {
              value: "襄阳市",
              label: "襄阳市",
            },
            {
              value: "荆门市",
              label: "荆门市",
            },
            {
              value: "孝感市",
              label: "孝感市",
            },
            {
              value: "黄冈市",
              label: "黄冈市",
            },
            {
              value: "鄂州市",
              label: "鄂州市",
            },
            {
              value: "黄石市",
              label: "黄石市",
            },
            {
              value: "咸宁市",
              label: "咸宁市",
            },
            {
              value: "荆州市",
              label: "荆州市",
            },
            {
              value: "宜昌市",
              label: "宜昌市",
            },
            {
              value: "随州市",
              label: "随州市",
            },
            {
              value: "丹江口市",
              label: "丹江口市",
            },
            {
              value: "老河口市",
              label: "老河口市",
            },
            {
              value: "枣阳市",
              label: "枣阳市",
            },
            {
              value: "宜城市",
              label: "宜城市",
            },
            {
              value: "钟祥市",
              label: "钟祥市",
            },
            {
              value: "汉川市",
              label: "汉川市",
            },
            {
              value: "应城市",
              label: "应城市",
            },
            {
              value: "安陆市",
              label: "安陆市",
            },
            {
              value: "广水市",
              label: "广水市",
            },
            {
              value: "麻城市",
              label: "麻城市",
            },
            {
              value: "武穴市",
              label: "武穴市",
            },
            {
              value: "大冶市",
              label: "大冶市",
            },
            {
              value: "赤壁市",
              label: "赤壁市",
            },
            {
              value: "石首市",
              label: "石首市",
            },
            {
              value: "洪湖市",
              label: "洪湖市",
            },
            {
              value: "松滋市",
              label: "松滋市",
            },
            {
              value: "宜都市",
              label: "宜都市",
            },
            {
              value: "枝江市",
              label: "枝江市",
            },
            {
              value: "当阳市",
              label: "当阳市",
            },
            {
              value: "恩施市",
              label: "恩施市",
            },
            {
              value: "利川市",
              label: "利川市",
            },
            {
              value: "仙桃市",
              label: "仙桃市",
            },
            {
              value: "天门市",
              label: "天门市",
            },
            {
              value: "潜江市",
              label: "潜江市",
            },
          ],
          value: "湖北省",
          label: "湖北省",
        },
        {
          children: [
            {
              value: "长沙市",
              label: "长沙市",
            },
            {
              value: "衡阳市",
              label: "衡阳市",
            },
            {
              value: "张家界市",
              label: "张家界市",
            },
            {
              value: "常德市",
              label: "常德市",
            },
            {
              value: "益阳市",
              label: "益阳市",
            },
            {
              value: "岳阳市",
              label: "岳阳市",
            },
            {
              value: "株洲市",
              label: "株洲市",
            },
            {
              value: "湘潭市",
              label: "湘潭市",
            },
            {
              value: "郴州市",
              label: "郴州市",
            },
            {
              value: "永州市",
              label: "永州市",
            },
            {
              value: "邵阳市",
              label: "邵阳市",
            },
            {
              value: "怀化市",
              label: "怀化市",
            },
            {
              value: "娄底市",
              label: "娄底市",
            },
            {
              value: "耒阳市",
              label: "耒阳市",
            },
            {
              value: "常宁市",
              label: "常宁市",
            },
            {
              value: "浏阳市",
              label: "浏阳市",
            },
            {
              value: "津市市",
              label: "津市市",
            },
            {
              value: "沅江市",
              label: "沅江市",
            },
            {
              value: "汨罗市",
              label: "汨罗市",
            },
            {
              value: "临湘市",
              label: "临湘市",
            },
            {
              value: "醴陵市",
              label: "醴陵市",
            },
            {
              value: "湘乡市",
              label: "湘乡市",
            },
            {
              value: "韶山市",
              label: "韶山市",
            },
            {
              value: "资兴市",
              label: "资兴市",
            },
            {
              value: "武冈市",
              label: "武冈市",
            },
            {
              value: "洪江市",
              label: "洪江市",
            },
            {
              value: "冷水江市",
              label: "冷水江市",
            },
            {
              value: "涟源市",
              label: "涟源市",
            },
            {
              value: "吉首市",
              label: "吉首市",
            },
          ],
          value: "湖南省",
          label: "湖南省",
        },
        {
          children: [
            {
              value: "广州市",
              label: "广州市",
            },
            {
              value: "深圳市",
              label: "深圳市",
            },
            {
              value: "清远市",
              label: "清远市",
            },
            {
              value: "韶关市",
              label: "韶关市",
            },
            {
              value: "河源市",
              label: "河源市",
            },
            {
              value: "梅州市",
              label: "梅州市",
            },
            {
              value: "潮州市",
              label: "潮州市",
            },
            {
              value: "汕头市",
              label: "汕头市",
            },
            {
              value: "揭阳市",
              label: "揭阳市",
            },
            {
              value: "汕尾市",
              label: "汕尾市",
            },
            {
              value: "惠州市",
              label: "惠州市",
            },
            {
              value: "东莞市",
              label: "东莞市",
            },
            {
              value: "珠海市",
              label: "珠海市",
            },
            {
              value: "中山市",
              label: "中山市",
            },
            {
              value: "江门市",
              label: "江门市",
            },
            {
              value: "佛山市",
              label: "佛山市",
            },
            {
              value: "肇庆市",
              label: "肇庆市",
            },
            {
              value: "云浮市",
              label: "云浮市",
            },
            {
              value: "阳江市",
              label: "阳江市",
            },
            {
              value: "茂名市",
              label: "茂名市",
            },
            {
              value: "湛江市",
              label: "湛江市",
            },
            {
              value: "英德市",
              label: "英德市",
            },
            {
              value: "连州市",
              label: "连州市",
            },
            {
              value: "乐昌市",
              label: "乐昌市",
            },
            {
              value: "南雄市",
              label: "南雄市",
            },
            {
              value: "兴宁市",
              label: "兴宁市",
            },
            {
              value: "普宁市",
              label: "普宁市",
            },
            {
              value: "陆丰市",
              label: "陆丰市",
            },
            {
              value: "恩平市",
              label: "恩平市",
            },
            {
              value: "台山市",
              label: "台山市",
            },
            {
              value: "开平市",
              label: "开平市",
            },
            {
              value: "鹤山市",
              label: "鹤山市",
            },
            {
              value: "四会市",
              label: "四会市",
            },
            {
              value: "罗定市",
              label: "罗定市",
            },
            {
              value: "阳春市",
              label: "阳春市",
            },
            {
              value: "化州市",
              label: "化州市",
            },
            {
              value: "信宜市",
              label: "信宜市",
            },
            {
              value: "高州市",
              label: "高州市",
            },
            {
              value: "吴川市",
              label: "吴川市",
            },
            {
              value: "廉江市",
              label: "廉江市",
            },
            {
              value: "雷州市",
              label: "雷州市",
            },
          ],
          value: "广东省",
          label: "广东省",
        },
        {
          children: [
            {
              value: "南宁市",
              label: "南宁市",
            },
            {
              value: "桂林市",
              label: "桂林市",
            },
            {
              value: "柳州市",
              label: "柳州市",
            },
            {
              value: "梧州市",
              label: "梧州市",
            },
            {
              value: "贵港市",
              label: "贵港市",
            },
            {
              value: "玉林市",
              label: "玉林市",
            },
            {
              value: "钦州市",
              label: "钦州市",
            },
            {
              value: "北海市",
              label: "北海市",
            },
            {
              value: "防城港市",
              label: "防城港市",
            },
            {
              value: "崇左市",
              label: "崇左市",
            },
            {
              value: "百色市",
              label: "百色市",
            },
            {
              value: "河池市",
              label: "河池市",
            },
            {
              value: "来宾市",
              label: "来宾市",
            },
            {
              value: "贺州市",
              label: "贺州市",
            },
            {
              value: "岑溪市",
              label: "岑溪市",
            },
            {
              value: "桂平市",
              label: "桂平市",
            },
            {
              value: "北流市",
              label: "北流市",
            },
            {
              value: "东兴市",
              label: "东兴市",
            },
            {
              value: "凭祥市",
              label: "凭祥市",
            },
            {
              value: "宜州市",
              label: "宜州市",
            },
            {
              value: "合山市",
              label: "合山市",
            },
            {
              value: "靖西市",
              label: "靖西市",
            },
          ],
          value: "广西壮族自治区",
          label: "广西壮族自治区",
        },
        {
          children: [
            {
              value: "海口市",
              label: "海口市",
            },
            {
              value: "三亚市",
              label: "三亚市",
            },
            {
              value: "三沙市",
              label: "三沙市",
            },
            {
              value: "儋州市",
              label: "儋州市",
            },
            {
              value: "文昌市",
              label: "文昌市",
            },
            {
              value: "琼海市",
              label: "琼海市",
            },
            {
              value: "万宁市",
              label: "万宁市",
            },
            {
              value: "东方市",
              label: "东方市",
            },
            {
              value: "五指山市",
              label: "五指山市",
            },
          ],
          value: "海南省",
          label: "海南省",
        },
        {
          value: "四川省",
          label: "四川省",
          children: [
            {
              value: "成都市",
              label: "成都市",
            },
            {
              value: "广元市",
              label: "广元市",
            },
            {
              value: "绵阳市",
              label: "绵阳市",
            },
            {
              value: "德阳市",
              label: "德阳市",
            },
            {
              value: "南充市",
              label: "南充市",
            },
            {
              value: "广安市",
              label: "广安市",
            },
            {
              value: "遂宁市",
              label: "遂宁市",
            },
            {
              value: "内江市",
              label: "内江市",
            },
            {
              value: "乐山市",
              label: "乐山市",
            },
            {
              value: "自贡市",
              label: "自贡市",
            },
            {
              value: "泸州市",
              label: "泸州市",
            },
            {
              value: "宜宾市",
              label: "宜宾市",
            },
            {
              value: "攀枝花市",
              label: "攀枝花市",
            },
            {
              value: "巴中市",
              label: "巴中市",
            },
            {
              value: "达州市",
              label: "达州市",
            },
            {
              value: "资阳市",
              label: "资阳市",
            },
            {
              value: "眉山市",
              label: "眉山市",
            },
            {
              value: "雅安市",
              label: "雅安市",
            },
            {
              value: "崇州市",
              label: "崇州市",
            },
            {
              value: "邛崃市",
              label: "邛崃市",
            },
            {
              value: "都江堰市",
              label: "都江堰市",
            },
            {
              value: "彭州市",
              label: "彭州市",
            },
            {
              value: "江油市",
              label: "江油市",
            },
            {
              value: "什邡市",
              label: "什邡市",
            },
            {
              value: "广汉市",
              label: "广汉市",
            },
            {
              value: "绵竹市",
              label: "绵竹市",
            },
            {
              value: "阆中市",
              label: "阆中市",
            },
            {
              value: "华蓥市",
              label: "华蓥市",
            },
            {
              value: "峨眉山市",
              label: "峨眉山市",
            },
            {
              value: "万源市",
              label: "万源市",
            },
            {
              value: "简阳市",
              label: "简阳市",
            },
            {
              value: "西昌市",
              label: "西昌市",
            },
            {
              value: "康定市",
              label: "康定市",
            },
            {
              value: "马尔康市",
              label: "马尔康市",
            },
            {
              value: "阿坝藏族羌族自治州",
              label: "阿坝藏族羌族自治州",
            },
            {
              value: "甘孜藏族自治州",
              label: "甘孜藏族自治州",
            },
            {
              value: "凉山彝族自治州",
              label: "凉山彝族自治州",
            },
          ],
        },
        {
          children: [
            {
              value: "贵阳市",
              label: "贵阳市",
            },
            {
              value: "六盘水市",
              label: "六盘水市",
            },
            {
              value: "遵义市",
              label: "遵义市",
            },
            {
              value: "安顺市",
              label: "安顺市",
            },
            {
              value: "毕节市",
              label: "毕节市",
            },
            {
              value: "铜仁市",
              label: "铜仁市",
            },
            {
              value: "黔东南苗族侗族自治州",
              label: "黔东南苗族侗族自治州",
            },
            {
              value: "黔南布依族苗族自治州",
              label: "黔南布依族苗族自治州",
            },
            {
              value: "黔西南布依族苗族自治州",
              label: "黔西南布依族苗族自治州",
            },
          ],
          value: "贵州省",
          label: "贵州省",
        },
        {
          children: [
            {
              value: "昆明市",
              label: "昆明市",
            },
            {
              value: "曲靖市",
              label: "曲靖市",
            },
            {
              value: "玉溪市",
              label: "玉溪市",
            },
            {
              value: "丽江市",
              label: "丽江市",
            },
            {
              value: "昭通市",
              label: "昭通市",
            },
            {
              value: "普洱市",
              label: "普洱市",
            },
            {
              value: "临沧市",
              label: "临沧市",
            },
            {
              value: "保山市",
              label: "保山市",
            },
            {
              value: "安宁市",
              label: "安宁市",
            },
            {
              value: "宣威市",
              label: "宣威市",
            },
            {
              value: "芒市",
              label: "芒市",
            },
            {
              value: "瑞丽市",
              label: "瑞丽市",
            },
            {
              value: "大理市",
              label: "大理市",
            },
            {
              value: "楚雄市",
              label: "楚雄市",
            },
            {
              value: "个旧市",
              label: "个旧市",
            },
            {
              value: "开远市",
              label: "开远市",
            },
            {
              value: "蒙自市",
              label: "蒙自市",
            },
            {
              value: "弥勒市",
              label: "弥勒市",
            },
            {
              value: "景洪市",
              label: "景洪市",
            },
            {
              value: "文山市",
              label: "文山市",
            },
            {
              value: "香格里拉市",
              label: "香格里拉市",
            },
            {
              value: "腾冲市",
              label: "腾冲市",
            },
          ],
          value: "云南省",
          label: "云南省",
        },
        {
          children: [
            {
              value: "西安市",
              label: "西安市",
            },
            {
              value: "延安市",
              label: "延安市",
            },
            {
              value: "铜川市",
              label: "铜川市",
            },
            {
              value: "渭南市",
              label: "渭南市",
            },
            {
              value: "咸阳市",
              label: "咸阳市",
            },
            {
              value: "宝鸡市",
              label: "宝鸡市",
            },
            {
              value: "汉中市",
              label: "汉中市",
            },
            {
              value: "榆林市",
              label: "榆林市",
            },
            {
              value: "商洛市",
              label: "商洛市",
            },
            {
              value: "安康市",
              label: "安康市",
            },
            {
              value: "韩城",
              label: "韩城",
            },
            {
              value: "华阴",
              label: "华阴",
            },
            {
              value: "兴平",
              label: "兴平",
            },
          ],
          value: "陕西省",
          label: "陕西省",
        },
        {
          children: [
            {
              value: "兰州市",
              label: "兰州市",
            },
            {
              value: "嘉峪关市",
              label: "嘉峪关市",
            },
            {
              value: "金昌市",
              label: "金昌市",
            },
            {
              value: "白银市",
              label: "白银市",
            },
            {
              value: "天水市",
              label: "天水市",
            },
            {
              value: "酒泉市",
              label: "酒泉市",
            },
            {
              value: "张掖市",
              label: "张掖市",
            },
            {
              value: "武威市",
              label: "武威市",
            },
            {
              value: "庆阳市",
              label: "庆阳市",
            },
            {
              value: "平凉市",
              label: "平凉市",
            },
            {
              value: "定西市",
              label: "定西市",
            },
            {
              value: "陇南市",
              label: "陇南市",
            },
            {
              value: "玉门市",
              label: "玉门市",
            },
            {
              value: "敦煌市",
              label: "敦煌市",
            },
            {
              value: "临夏市",
              label: "临夏市",
            },
            {
              value: "合作市",
              label: "合作市",
            },
          ],
          value: "甘肃省",
          label: "甘肃省",
        },
        {
          children: [
            {
              value: "西宁市",
              label: "西宁市",
            },
            {
              value: "海东市",
              label: "海东市",
            },
            {
              value: "格尔木市",
              label: "格尔木市",
            },
            {
              value: "德令哈市",
              label: "德令哈市",
            },
            {
              value: "玉树市",
              label: "玉树市",
            },
          ],
          value: "青海省",
          label: "青海省",
        },
        {
          children: [
            {
              value: "拉萨市",
              label: "拉萨市",
            },
            {
              value: "日喀则市",
              label: "日喀则市",
            },
            {
              value: "昌都市",
              label: "昌都市",
            },
            {
              value: "林芝市",
              label: "林芝市",
            },
            {
              value: "山南市",
              label: "山南市",
            },
          ],
          value: "西藏自治区",
          label: "西藏自治区",
        },
        {
          children: [
            {
              value: "银川市",
              label: "银川市",
            },
            {
              value: "石嘴山市",
              label: "石嘴山市",
            },
            {
              value: "吴忠市",
              label: "吴忠市",
            },
            {
              value: "中卫市",
              label: "中卫市",
            },
            {
              value: "固原市",
              label: "固原市",
            },
            {
              value: "灵武市",
              label: "灵武市",
            },
            {
              value: "青铜峡市",
              label: "青铜峡市",
            },
          ],
          value: "宁夏回族自治区",
          label: "宁夏回族自治区",
        },
        {
          children: [
            {
              value: "台北市",
              label: "台北市",
            },
            {
              value: "新北市",
              label: "新北市",
            },
            {
              value: "桃园市",
              label: "桃园市",
            },
            {
              value: "台中市",
              label: "台中市",
            },
            {
              value: "台南市",
              label: "台南市",
            },
            {
              value: "高雄市",
              label: "高雄市",
            },
            {
              value: "基隆市",
              label: "基隆市",
            },
            {
              value: "新竹市",
              label: "新竹市",
            },
            {
              value: "嘉义市",
              label: "嘉义市",
            },
          ],
          value: "台湾",
          label: "台湾",
        },
        {
          children: [
            {
              value: "北京市",
              label: "北京市",
            },
          ],
          value: "北京市",
          label: "北京市",
        },
        {
          children: [
            {
              value: "天津市",
              label: "天津市",
            },
          ],
          value: "天津市",
          label: "天津市",
        },
        {
          children: [
            {
              value: "上海市",
              label: "上海市",
            },
          ],
          value: "上海市",
          label: "上海市",
        },
        {
          children: [
            {
              value: "重庆市",
              label: "重庆市",
            },
          ],
          value: "重庆市",
          label: "重庆市",
        },
        {
          children: [
            {
              value: "香港特别行政区",
              label: "香港特别行政区",
            },
          ],
          value: "香港",
          label: "香港",
        },
        {
          children: [
            {
              value: "澳门特别行政区",
              label: "澳门特别行政区",
            },
          ],
          value: "澳门",
          label: "澳门",
        },
        {
          children: [
            {
              value: "乌鲁木齐市",
              label: "乌鲁木齐市",
            },
            {
              value: "克拉玛依市",
              label: "克拉玛依市",
            },
            {
              value: "吐鲁番市",
              label: "吐鲁番市",
            },
            {
              value: "哈密市",
              label: "哈密市",
            },
            {
              value: "喀什市",
              label: "喀什市",
            },
            {
              value: "阿克苏市",
              label: "阿克苏市",
            },
            {
              value: "和田市",
              label: "和田市",
            },
            {
              value: "阿图什市",
              label: "阿图什市",
            },
            {
              value: "阿拉山口市",
              label: "阿拉山口市",
            },
            {
              value: "博乐市",
              label: "博乐市",
            },
            {
              value: "昌吉市",
              label: "昌吉市",
            },
            {
              value: "阜康市",
              label: "阜康市",
            },
            {
              value: "库尔勒市",
              label: "库尔勒市",
            },
            {
              value: "伊宁市",
              label: "伊宁市",
            },
            {
              value: "奎屯市",
              label: "奎屯市",
            },
            {
              value: "塔城市",
              label: "塔城市",
            },
            {
              value: "乌苏市",
              label: "乌苏市",
            },
            {
              value: "阿勒泰市",
              label: "阿勒泰市",
            },
            {
              value: "霍尔果斯市",
              label: "霍尔果斯市",
            },
            {
              value: "石河子市",
              label: "石河子市",
            },
            {
              value: "阿拉尔市",
              label: "阿拉尔市",
            },
            {
              value: "图木舒克市",
              label: "图木舒克市",
            },
            {
              value: "五家渠市",
              label: "五家渠市",
            },
            {
              value: "北屯市",
              label: "北屯市",
            },
            {
              value: "铁门关市",
              label: "铁门关市",
            },
            {
              value: "双河市",
              label: "双河市",
            },
            {
              value: "可克达拉市",
              label: "可克达拉市",
            },
            {
              value: "昆玉市",
              label: "昆玉市",
            },
          ],
          value: "新疆维吾尔自治区",
          label: "新疆维吾尔自治区",
        },
      ],
      headers: {
        token: localStorage.getItem("token"), // 如果需要身份验证
      },
      deleteone: false,
      deletetwo: false,
      submit: false,
      status: true,
      expertid: "",
      flagfirst: 0,
      Photo: "",
      activeName: "first", // 默认激活的第一个标签页
      canSwitchTabs: false, // 控制是否允许切换标签页的标志
      selectedFile: [{ name: "", file: "" }],
      sexs: [
        {
          value: "男",
          label: "男",
        },
        {
          value: "女",
          label: "女",
        },
      ],
      polite: [
        {
          value: "中共党员",
          label: "中共党员",
        },
        {
          value: "中共预备党员",
          label: "中共预备党员",
        },
        {
          value: "共青团员",
          label: "共青团员",
        },
        {
          value: "民主党派成员",
          label: "民主党派成员",
        },
        {
          value: "无党派人士",
          label: "无党派人士",
        },
        {
          value: "群众",
          label: "群众",
        },
      ],
      education: [
        {
          value: "博士研究生",
          label: "博士研究生",
        },
        {
          value: "硕士研究生",
          label: "硕士研究生",
        },
        {
          value: "大学本科",
          label: "大学本科",
        },
        {
          value: "大学专科",
          label: "大学专科",
        },
        {
          value: "高中/中专",
          label: "高中/中专",
        },
        {
          value: "初中及以下",
          label: "初中及以下",
        },
      ],
      // polite:[
      //   {
      //     value: "中共党员",
      //     label: "中共党员",
      //   },
      //   {
      //     value: "中共预备党员",
      //     label: "中共预备党员",
      //   },,
      //   {
      //     value: "民主党派成员",
      //     label: "民主党派成员",
      //   },
      //   {
      //     value: "共青团员",
      //     label: "共青团员",
      //   },
      //   {
      //     value: "民主党派成员",
      //     label: "民主党派成员",
      //   },
      //   {
      //     value: "无党派人士",
      //     label: "无党派人士",
      //   }
      //   ,
      //   {
      //     value: "群众",
      //     label: "群众",
      //   },
      // ],
      titles: [
        {
          value: "副高级职称",
          label: "副高级职称",
        },
        {
          value: "正高级职称",
          label: "正高级职称",
        },
        {
          value: "同等执业资格",
          label: "同等执业资格",
        },
        {
          value: "其他",
          label: "其他",
        },
      ],
      cansave: true,
      formLabelAlign: {
        id: "",
        name: "",
        gender: "",
        expertId: "",
        ethnicity: "",
        birthDate: "",
        idCard: "",
        nativePlace: "",
        politicalStatus: "",
        healthStatus: "",
        education: "",
        graduateSchool: "",
        workUnit: "",
        belong: "",
        job: "",
        title: "",
        isPublicOfficial: "",
        phone: "",
        email: "",
        bankName: "",
        bankAccount: "",
        photoUrl: "",
        primaryMajor: "",
        secondMajor: "",
        thirdMajor: "",
        fourthMajor: "",
        fifthMajor: "",
        registeredQualification: "",
        workTime: "",
        isAcademic: "",
        isDesignMaster: "",
        isSubsidy: "",
        isSpecial: "",
        auditOpinion: "",
        auditStatus: "待审核",
      },
      basephoto: "",
      tableData: [
        {
          id: null,
          expertId: null,
          orgName: "",
          startDate: "",
          endDate: "",
          title: "",
          position: "",
          createTime: "",
          updateTime: "",
        },
      ],
      fileshow: ["0", "0", "0", "0", "0"],
      tableData1: [
        {
          id: null,
          expertId: null,
          orgName: "",
          startDate: "",
          endDate: "",
          role: "",
          createTime: "",
          updateTime: "",
        },
      ],
      selectedRows: [], // 存储被选中的行
      selectedRows1: [], // 存储被选中的行
      major: {
        one: "",
        two: "",
        three: "",
        four: "",
        five: "",
      },
      other: {
        id: null,
        expertId: null,
        researchResults: "",
        projectConsultation: "",
        createTime: "",
        updateTime: "",
      },
      showworkfalse: true,
      options1: [
        {
          value: "督查稽察",
          label: "督查稽察",
          children: [
            {
              value: "建设管理",
              label: "建设管理",
            },
            {
              value: "计划管理",
              label: "计划管理",
            },
            {
              value: "质量管理",
              label: "质量管理",
            },
            {
              value: "安全管理",
              label: "安全管理",
            },
          ],
        },
        {
          value: "水利规划",
          label: "水利规划",
        },
        {
          value: "水文泥沙",
          label: "水文泥沙",
        },
        {
          value: "水资源",
          label: "水资源",
        },
        {
          value: "节水评价",
          label: "节水评价",
        },
        {
          value: "水土保持",
          label: "水土保持",
        },
        {
          value: "农田水利",
          label: "农田水利",
        },
        {
          value: "城乡供水",
          label: "城乡供水",
        },
        {
          value: "水工结构",
          label: "水工结构",
        },
        {
          value: "河道治理",
          label: "河道治理",
        },
        {
          value: "工程地质与工程测绘",
          label: "工程地质与工程测绘",
        },
        {
          value: "水旱灾害防御抢险",
          label: "水旱灾害防御抢险",
        },
        {
          value: "工程造价与经济评价",
          label: "工程造价与经济评价",
        },
        {
          value: "征地移民",
          label: "征地移民",
        },
        {
          value: "电气机电与金属结构",
          label: "电气机电与金属结构",
        },
        {
          value: "水利政策法规",
          label: "水利政策法规",
        },
        {
          value: "施工组织与管理",
          label: "施工组织与管理",
        },
        {
          value: "水利信息化",
          label: "水利信息化",
        },
        {
          value: "工程管理",
          label: "工程管理",
        },
        {
          value: "节能评价",
          label: "节能评价",
        },
        {
          value: "资金管理",
          label: "资金管理",
        },
        {
          value: "水力发电",
          label: "水力发电",
        },
        {
          value: "劳动安全与工业卫生",
          label: "劳动安全与工业卫生",
        },
        {
          value: "环境影响评价",
          label: "环境影响评价",
        },
        {
          value: "社会稳定分析",
          label: "社会稳定分析",
        },
        {
          value: "质量检测",
          label: "质量检测",
        },
        {
          value: "水文化",
          label: "水文化",
        },
      ],
      options: [
        {
          value: "无",
          label: "无",
        },
        {
          value: "督查稽察",
          label: "督查稽察",
          children: [
            {
              value: "建设管理",
              label: "建设管理",
            },
            {
              value: "计划管理",
              label: "计划管理",
            },
            {
              value: "质量管理",
              label: "质量管理",
            },
            {
              value: "安全管理",
              label: "安全管理",
            },
          ],
        },
        {
          value: "水利规划",
          label: "水利规划",
        },
        {
          value: "水文泥沙",
          label: "水文泥沙",
        },
        {
          value: "水资源",
          label: "水资源",
        },
        {
          value: "节水评价",
          label: "节水评价",
        },
        {
          value: "水土保持",
          label: "水土保持",
        },
        {
          value: "农田水利",
          label: "农田水利",
        },
        {
          value: "城乡供水",
          label: "城乡供水",
        },
        {
          value: "水工结构",
          label: "水工结构",
        },
        {
          value: "河道治理",
          label: "河道治理",
        },
        {
          value: "工程地质与工程测绘",
          label: "工程地质与工程测绘",
        },
        {
          value: "水旱灾害防御抢险",
          label: "水旱灾害防御抢险",
        },
        {
          value: "工程造价与经济评价",
          label: "工程造价与经济评价",
        },
        {
          value: "征地移民",
          label: "征地移民",
        },
        {
          value: "电气机电与金属结构",
          label: "电气机电与金属结构",
        },
        {
          value: "水利政策法规",
          label: "水利政策法规",
        },
        {
          value: "施工组织与管理",
          label: "施工组织与管理",
        },
        {
          value: "水利信息化",
          label: "水利信息化",
        },
        {
          value: "工程管理",
          label: "工程管理",
        },
        {
          value: "节能评价",
          label: "节能评价",
        },
        {
          value: "资金管理",
          label: "资金管理",
        },
        {
          value: "水力发电",
          label: "水力发电",
        },
        {
          value: "劳动安全与工业卫生",
          label: "劳动安全与工业卫生",
        },
        {
          value: "环境影响评价",
          label: "环境影响评价",
        },
        {
          value: "社会稳定分析",
          label: "社会稳定分析",
        },
        {
          value: "质量检测",
          label: "质量检测",
        },
        {
          value: "水文化",
          label: "水文化",
        },
      ],
      textarea2: "",
      textarea1: "",

      fileone: [],
      filetwo: [],
      filethree: [],
      filefour: [],
      filefive: [],
      fileflag: 0,
      expertid: "",
      uploadUrl: "",
      showmajorerror: [0, 0, 0, 0, 0],
      saveoneflag: false,
      savetwoflag: false,
      savethreeflag: false,
      files: {
        idCard: null,
        certificate: null,
        qualification: null,
        supportMater: null,
        applicationForm: null,
      },
      photourl: "",
      rules: {
        bankAccount: [
          { required: true, message: "请输入银行账号", trigger: "blur" },
          {
            pattern: /^\d{16,20}$/,
            message: "银行账号应为16到20位的数字",
            trigger: "blur",
          },
        ],
        bankName: [
          { required: true, message: "请输入银行名称", trigger: "blur" },
          {
            min: 4,
            max: 10,
            message: "长度在 4 到 10 个字符",
            trigger: "blur",
          },
        ],
        birthDate: [
          { required: true, message: "请选择日期", trigger: "blur" },
          {
            validator: (rule, value, callback) => {
              if (!value) {
                // 必填项检查已经在上一个规则中处理，这里不需要重复检查
                callback();
                return;
              }

              const birthDate = new Date(value);
              const today = new Date();

              let age = today.getFullYear() - birthDate.getFullYear();
              const monthDiff = today.getMonth() - birthDate.getMonth();
              const dayDiff = today.getDate() - birthDate.getDate();
              // 如果生日还没到（即当前月份小于出生月份，或者当前月份等于出生月份但今天的日期小于出生日期），减去一年
              if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
                age--;
              }

              // 检查是否超过75岁，精确到年月日
              if (
                age > 75 ||
                (age === 75 &&
                  (monthDiff > 0 || (monthDiff === 0 && dayDiff > 0)))
              ) {
                callback(new Error("年龄不能超过75周岁"));
              } else {
                callback();
              }
            },
            trigger: "blur",
          },
        ],
        // education: [{ required: true, message: "请输入学历", trigger: "blur" }],
        education: [
          { required: true, message: "请输入学历", trigger: "change" },
        ],
        ethnicity: [{ required: true, message: "请输入民族", trigger: "blur" }],
        fifthMajor: [
          { required: true, message: "请选择专业", trigger: "change" },
        ],
        primaryMajor: [
          { required: true, message: "请选择专业", trigger: "change" },
        ],
        fourthMajor: [
          { required: true, message: "请选择专业", trigger: "change" },
        ],
        email: [
          { required: true, message: "请输入邮箱", trigger: "blur" },
          {
            validator(rule, value, callback) {
              const emailRegex =
                /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;

              if (value === "") {
                callback(new Error("请输入邮箱"));
              } else if (!emailRegex.test(value)) {
                // 使用正则表达式进行邮箱格式验证
                callback(new Error("请输入有效的邮箱地址"));
              } else {
                callback(); // 验证通过
              }
            },
            trigger: "blur",
          },
        ],
        gender: [{ required: true, message: "请选择性别", trigger: "blur" }],
        graduateSchool: [
          { required: true, message: "请输入毕业院校", trigger: "blur" },
        ],
        healthStatus: [
          { required: true, message: "请输入健康状况", trigger: "blur" },
        ],
        idCard: [
          { required: true, message: "请输入身份证号", trigger: "blur" },
          {
            pattern:
              /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[0-9Xx]$/,
            message: "请输入有效的身份证号",
            trigger: "blur",
          },
        ],
        isAcademic: [
          {
            required: true,
            message: "请选择",
            trigger: "change",
          },
        ],
        isDesignMaster: [
          {
            required: true,
            message: "请选择",
            trigger: "change",
          },
        ],
        isPublicOfficial: [
          {
            required: true,
            message: "请选择",
            trigger: "change",
          },
        ],
        isSpecial: [
          {
            required: true,
            message: "请选择",
            trigger: "change",
          },
        ],
        isSubsidy: [
          {
            required: true,
            message: "请选择",
            trigger: "change",
          },
        ],
        job: [{ required: true, message: "请输入职务", trigger: "change" }],

        name: [
          { required: true, message: "请输入姓名", trigger: "blur" },
          {
            validator: (rule, value, callback) => {
              if (value.trim() === "") {
                callback(new Error("姓名不能为空"));
              } else {
                callback();
              }
            },
            trigger: "blur",
          },
        ],

        nativePlace: [
          { required: true, message: "请输入地址", trigger: "change" },
        ],
        phone: [
          { required: true, message: "请输入手机号码", trigger: "blur" },
          {
            pattern: /^1[3-9]\d{9}$/,
            message: "请输入正确的手机号码",
            trigger: "blur",
          },
        ],
        photoUrl: [
          { required: true, message: "请输入图片", trigger: "change" },
        ],
        politicalStatus: [
          { required: true, message: "请输入政治面貌", trigger: "change" },
        ],
        registeredQualification: [
          {
            required: true,
            message: "请输入国家执业注册资格",
            trigger: "change",
          },
        ],
        secondMajor: [
          { required: true, message: "请选择专业", trigger: "change" },
        ],
        thirdMajor: [
          { required: true, message: "请选择专业", trigger: "change" },
        ],
        title: [{ required: true, message: "请选择职称", trigger: "change" }],
        workTime: [
          { required: true, message: "请输入工作年限", trigger: "blur" },
          {
            pattern: /^\d+(\.\d+)?$/,
            message: "请输入有效的数字",
            trigger: "blur",
          },
          {
            validator: (rule, value, callback) => {
              if (value < 8) {
                callback(new Error("工作年限不得小于8年"));
              } else {
                callback();
              }
            },
            trigger: "blur",
          },
        ],
        workUnit: [
          { required: true, message: "请输入工作单位", trigger: "change" },
        ],
        // 添加其他字段的验证规则...
      },
      rules1: {
        researchResults: [
          { required: true, message: "请输入专业领域及成果", trigger: "blur" },
          // {
          //   validator(rule, value, callback) {
          //     const maxLength = 800;
          //     if (value.length > maxLength) {
          //       callback(new Error(`输入内容不能超过${maxLength}个字符`));
          //     } else {
          //       callback();
          //     }
          //   },
          //   trigger: "blur",
          // },
        ],
        projectConsultation: [
          {
            required: true,
            message: "请输入参加过何种项目和课题",
            trigger: "blur",
          },
          // {
          //   validator(rule, value, callback) {
          //     const maxLength = 800;
          //     if (value.length > maxLength) {
          //       callback(new Error(`输入内容不能超过${maxLength}个字符`));
          //     } else {
          //       callback();
          //     }
          //   },
          //   trigger: "blur",
          // },
        ],
      },
      FFive: { name: "", url: "" },
      FFour: { name: "", url: "" },
      FThree: { name: "", url: "" },
      FTwo: { name: "", url: "" },
      FOne: { name: "", url: "" },
      sid: "",
    };
  },
  methods: {
    remove(type) {
      switch (type) {
        case "idCard":
          this.FOne = { name: "", url: "" };
          this.fileone = [];
          // console.log("idCard");
          break;
        case "certificate":
          this.FTwo = { name: "", url: "" };
          this.filetwo = [];
          // console.log("certificate");
          break;
        case "qualification":
          this.FThree = { name: "", url: "" };
          this.filethree = [];
          // console.log("qualification");
          break;
        case "supportMater":
          this.FFour = { name: "", url: "" };
          this.filefour = [];
          // console.log("supportMater");
          break;
        case "applicationForm":
          console.log(999);
          this.FFive = { name: "", url: "" };
          this.filefive = [];

          // console.log("applicationForm");
          break;
      }
    },
    beforeUploadimg(file) {
      const isJPG = file.type === "image/jpeg";
      const isLt2M = file.size / 1024 / 1024 < 4;

      if (!isJPG) {
        this.$message.error("上传头像图片只能是 JPG 格式!");
      }
      if (!isLt2M) {
        this.$message.error("上传头像图片大小不能超过 4MB!");
      }
      // this.customUpload()
      return isJPG && isLt2M;
    },
    customUpload(file) {
      const formData = new FormData();
      console.log(file);
      formData.append("file", file);

      http
        .post("/admin/common/uploadImage", formData, {
          headers: {
            "Content-Type": "multipart/form-data",
          },
        })
        .then((response) => {
          console.log(response.data.data);

          this.$message.success("上传成功");
          this.photourl = response.data.data;
          console.log("photourl", this.photourl);
          // this.Photo = this.photourl; // 更新显示的图片
          this.Photo = "data:image/jpeg;base64," + this.photourl; // 假设是 JPEG 格式
          console.log(this.formLabelAlign);
        })
        .catch((error) => {
          console.error("上传失败:", error);
          // this.$message.error('上传失败');
        });
    },
    onremove(file, fileList, index) {
      console.log(index);
      switch (type) {
        case "idCard":
          this.FOne = file.name;
          console.log("idCard");
          break;
        case "certificate":
          this.FTwo.name = file.name;
          console.log("certificate");
          break;
        case "qualification":
          this.FThree.name = file.name;

          console.log("qualification");
          break;
        case "supportMater":
          this.FFour.name = file.name;

          console.log("supportMater");
          break;
        case "applicationForm":
          this.FFive.name = file.name;

          console.log("applicationForm");
          break;
      }
      console.log(123645);
    },
    saveone(num) {
      this.submitonlyForm("formRef")
        .then((res) => {
          console.log(num);
          this.saveoneflag = false;
          const formData = { ...this.formLabelAlign }; // 复制当前表单数据
          console.log(formData.primaryMajor);
          console.log(formData.secondMajor);
          console.log(formData.thirdMajor);
          console.log(formData.fourthMajor);
          console.log(formData.fifthMajor);
          const a = formData.primaryMajor.join("/");
          formData.primaryMajor = a;
          const b = formData.secondMajor.join("/");
          formData.secondMajor = b;
          const c = formData.thirdMajor.join("/");
          formData.thirdMajor = c;
          const d = formData.fourthMajor.join("/");
          formData.fourthMajor = d;
          const e = formData.fifthMajor.join("/");
          formData.fifthMajor = e;
          console.log(formData.primaryMajor);
          console.log(formData.secondMajor);
          console.log(formData.thirdMajor);
          console.log(formData.fourthMajor);
          console.log(formData.fifthMajor);
          console.log(this.formLabelAlign);
          // this.photourl
          console.log(this.photourl);
          formData.photoUrl = this.photourl;
          // console.log('formLabelAlign',this.formLabelAlign);
          // const id = localStorage.getItem('usrid')
          // // 如果需要，可以在这里对formData进行预处理，例如格式化日期等
          // console.log(id);
          // console.log(formData);
          // 处理日期
          // console.log(this.basephoto);
          // formData.photoUrl = this.basephoto;
          formData.nativePlace =
            formData.nativePlace[0] + "/" + formData.nativePlace[1];
          // console.log('formData',formData.nativePlace);
          // console.log('formData', formData);
          // 处理boolen值
          // console.log(this.expertid);
          formData.birthDate = this.formatDate(formData.birthDate);
          console.log(formData.birthDate);
          if (this.expertid == null) {
            console.log(123456);
          }

          // let expertid = localStorage.getItem("expertid");
          // console.log(expertid);
          // console.log(typeof expertid);
          // expertid = Number(expertid);
          console.log(this.flagfirst);
          // if (this.flagfirst == 1) {
          //   console.log("修改");
          //   http
          //     .get(`/expertBasicInfo/get/${expertid}`, formData, {
          //       headers: {
          //         "Content-Type": "application/json",
          //       },
          //     })
          //     .then((response) => {
          //       // console.log(提交数据);
          //       console.log("查询成功:", response.data.data);
          //       formData.id = response.data.data.id;
          //       // localStorage.setItem('expertid', response.data.data)

          //       // 可以在此处添加成功后的逻辑，如提示用户、重置表单等
          //     })
          //     .catch((error) => {
          //       console.error("提交失败:", error);
          //       // 错误处理逻辑
          //     });
          // } else {
          http
            .post(`/admin/expertBasicInfo/addOrUpdate`, formData, {
              headers: {
                "Content-Type": "application/json",
              },
            })
            .then((response) => {
              console.log(response.data.code);

              if (num == 0) {
                if (response.data.code == 0) {
                  Message.error(response.data.msg);
                } else {
                  console.log("更新", response);
                  Message.success("保存成功");
                  this.selectbasic();
                }
              }

              // console.log("提交成功:", response.data.data);
              this.flagfirst = 1;
              // this.expertid = response.data.data
              // localStorage.setItem("expertid", response.data.data);
              this.expertid = response.data.data;
              this.formLabelAlign.id = this.expertid;
              console.log(this.expertid);

              // 可以在此处添加成功后的逻辑，如提示用户、重置表单等
            })
            .catch((error) => {
              console.error("提交失败:", error);
              // 错误处理逻辑
            });
        })
        .catch((err) => {
          console.error("提交失败:", err.message || err);
          this.$message.error(err.message || "表单验证未通过"); // 使用弹窗提示错误
        });
    },
    selectbasic() {
      // const usrid = localStorage.getItem("usrid");
      const usrid = this.expertid;
      console.log(usrid);
      // /getByUserId/{userId}
      // this.selectwork()
      http
        .get(`/admin/expertBasicInfo/getByUserId/${usrid}`, {
          headers: {
            "Content-Type": "application/json",
          },
        })
        .then((response) => {
          console.log(response);
          const a = response.data.data.primaryMajor;
          response.data.data.primaryMajor = a.split("/");
          const b = response.data.data.secondMajor;
          response.data.data.secondMajor = b.split("/");
          const c = response.data.data.thirdMajor;
          response.data.data.thirdMajor = c.split("/");
          const d = response.data.data.fourthMajor;
          response.data.data.fourthMajor = d.split("/");
          const e = response.data.data.fifthMajor;
          response.data.data.fifthMajor = e.split("/");
          console.log(response.data.data.nativePlace);
          const parts = response.data.data.nativePlace.split("/");
          console.log(parts);
          // console.log(提交数据);
          console.log("查询成功:", response.data.data.id);
          this.expertid = response.data.data.expertId;
          console.log("expertid", this.expertid);
          // localStorage.setItem("expertid", response.data.data.id);
          this.formLabelAlign = response.data.data;
          this.formLabelAlign.nativePlace = parts;
          console.log("图片", response.data.data);
          this.photourl = response.data.data.photoUrl;
          // this.Photo = response.data.data.photoUrl
          this.Photo = "data:image/jpeg;base64," + response.data.data.photoUrl; // 假设是 JPEG 格式
          console.log(this.Photo);
          console.log("formLabelAlign", this.formLabelAlign);

          // this.Photo =this.formLabelAlign.photoUrl;
          // if (!this.formLabelAlign.fillStatus) {
          this.selectwork();
          this.selectsocial();
          this.selectother();
          this.selectpdf();
          // }
          // this.formLabelAlign.id = this.expertid
          // formData.id = response.data.data.id;
          // localStorage.setItem('expertid', response.data.data)

          // 可以在此处添加成功后的逻辑，如提示用户、重置表单等
        })
        .catch((error) => {
          console.error("提交失败:", error);
          // 错误处理逻辑
        });
    },
    handleSuccess(response, file, fileList, num) {
      console.log(num, "上传成功");
    },
    handledata(tableData) {
      for (let i = 0; i < tableData.length; i++) {
        if (
          Array.isArray(tableData[i].startDate) &&
          tableData[i].startDate.length >= 2
        ) {
          const start = this.formatDate(tableData[i].startDate[0]);
          const end = this.formatDate(tableData[i].startDate[1]);
          //   const start = tableData[i].startDate[0];
          //   const end = tableData[i].startDate[1];

          if (start !== null) tableData[i].startDate = start;
          if (end !== null) tableData[i].endDate = end;
        } else {
          console.error(
            `Invalid startDate format at index ${i}:`,
            tableData[i].startDate
          );
        }
      }
    },
    // formatDate(isoString) {
    //   if (!isoString) {
    //     console.warn("Received an invalid date string:", isoString);
    //     return null; // 或者返回一个默认值，取决于你的需求
    //   }

    //   const date = new Date(isoString);
    //   console.log(data);
    //   // 检查日期是否有效
    //   if (isNaN(date.getTime())) {
    //     console.error("Invalid date encountered:", isoString);
    //     return null; // 返回null或其他替代值
    //   }

    //   // 获取年、月、日，并格式化为 "YYYY-MM-DD"
    //   const year = date.getFullYear();
    //   const month = String(date.getMonth() + 1).padStart(2, "0"); // 月份从0开始，需加1
    //   const day = String(date.getDate()).padStart(2, "0");
    //   console.log(year,month,day);
    //   return `${year}-${month}-${day}`;
    // },
    savetwo(num) {
      try {
        this.$refs.other.validate((valid) => {
          if (valid) {
            // 如果验证成功，执行你的逻辑
            console.log("Validation succeeded");
            // 执行其他操作...
            const a =
              this.tableData.length === 0 || this.tableData[0].position == "";
            console.log(a);
            if (!a) {
              console.log(num);
              let work = 0;
              let social = 0;
              let other = 0;
              // 主要工作经历
              // console.log("保存", this.tableData);
              const tableData = this.tableData; // 直接引用当前表单数据
              console.log("tableData", tableData);
              this.handledata(tableData);
              for (let i = 0; i < tableData.length; i++) {
                tableData[i].startDate = this.formatDate(
                  tableData[i].startDate
                );
                tableData[i].endDate = this.formatDate(tableData[i].endDate);
                console.log(tableData[i].startDate);
                console.log(tableData[i].endDate);
              }
              // 收集需要删除的项的索引
              let indicesToDelete = [];
              for (let i = 0; i < tableData.length; i++) {
                if (
                  tableData[i].startDate == "" &&
                  tableData[i].orgName == "" &&
                  tableData[i].title == ""
                ) {
                  indicesToDelete.push(i);
                }
              }
              // 按照从后往前的顺序删除元素，避免索引混乱
              indicesToDelete.sort((a, b) => b - a); // 对索引进行降序排序
              console.log("indicesToDelete", indicesToDelete);
              for (let index of indicesToDelete) {
                tableData.splice(index, 1);
              }
              // log

              console.log("tableData", tableData); // 输出处理后的tableData
              // console.log(Array.isArray(tableData)); // 应该输出 true
              // console.log("工作经历发送请求之前", tableData);
              // for (let i = 0; i < tableData.length; i++) {
              //   if (!tableData[i].startDate) {
              //     // console.log("进入");
              //     // console.log(i);
              //     tableData[i].endDate = "";
              //     // console.log(tableData[i].endDate);
              //   }
              // }
              console.log(tableData);

              // 社会兼职、聘职情况
              // console.log(this.tableData1);
              const tableData1 = this.tableData1; // 直接引用当前表单数据
              // console.log("tableData", tableData1);
              for (let i = 0; i < tableData1.length; i++) {
                tableData1[i].startDate = this.formatDate(
                  tableData1[i].startDate
                );
                tableData1[i].endDate = this.formatDate(tableData1[i].endDate);
                console.log(tableData1[i].startDate);
                console.log(tableData1[i].endDate);
              }
              // this.handledata(tableData1);
              let indicesToDelete1 = [];
              for (let i = 0; i < tableData1.length; i++) {
                console.log(tableData1[i].startDate);
                console.log(tableData1[i].endDate);
                if (
                  tableData1[i].startDate == "" &&
                  tableData1[i].orgName == "" &&
                  tableData1[i].title == ""
                ) {
                  console.log(123);
                  indicesToDelete1.push(i);
                }
              }
              for (let i = 0; i < tableData1.length; i++) {
                if (
                  tableData1[i].startDate == "NaN-NaN-NaN" &&
                  tableData1[i].endDate == "NaN-NaN-NaN"
                ) {
                  // console.log(123);
                  indicesToDelete1.push(i);
                }
              }
              // 按照从后往前的顺序删除元素，避免索引混乱
              indicesToDelete1.sort((a, b) => b - a); // 对索引进行降序排序
              console.log("indicesToDelete1", indicesToDelete1);
              for (let index of indicesToDelete1) {
                tableData1.splice(index, 1);
              }
              console.log(tableData1);
              // console.log(Array.isArray(tableData1)); // 应该输出 true
              // console.log("发送请求之前", tableData1);
              // 获取expertid
              for (let i = 0; i < tableData.length; i++) {
                console.log(tableData[i].endDate);
                if (
                  tableData[i].endDate == "NaN-NaN-NaN" ||
                  tableData[i].endDate == "1970-01-01"
                ) {
                  console.log(123);
                  tableData[i].endDate = "";
                }
              }
              for (let i = 0; i < tableData1.length; i++) {
                console.log(tableData1[i].endDate);
                if (
                  tableData1[i].endDate == "NaN-NaN-NaN" ||
                  tableData1[i].endDate == "1970-01-01"
                ) {
                  console.log(123);
                  tableData1[i].endDate = "";
                }
                if (tableData1[i].startDate == "NaN-NaN-NaN") {
                  tableData1[i].startDate = "";
                }
              }
              let expertid = this.expertid;
              if (expertid === null || typeof expertid === "undefined") {
                console.error("Invalid expertid value");
              } else {
                // 准备所有请求的Promise
                const promises = [
                  // 工作经历请求
                  http
                    .post(`/admin/expertWorkExper/addOrUpdate`, tableData, {
                      headers: { "Content-Type": "application/json" },
                    })
                    .then((response) => {
                      work = 1;
                      this.selectwork();
                    })
                    .catch((err) => {
                      console.log(err.status);
                      if (err.status == 429) {
                        Message.warning("请勿频繁提交数据");
                      }
                    }),

                  // 社会兼职、聘职情况请求
                  http
                    .post(
                      `/admin/expertSocialPart/addOrUpdate`,
                      this.tableData1,
                      {
                        headers: { "Content-Type": "application/json" },
                      }
                    )
                    .then((response) => {
                      social = 1;
                      this.selectsocial();
                    }),

                  // 其他信息请求
                  http
                    .post(`/admin/expertOtherInfo/addOrUpdate`, this.other, {
                      headers: { "Content-Type": "application/json" },
                    })
                    .then((response) => {
                      if (response.data.code == 0) {
                        Message.error(response.data.msg);
                      } else {
                        other = 1;
                        this.selectother();
                      }
                    }),
                ];

                // 使用Promise.all并发执行所有请求
                Promise.all(promises)
                  .then(() => {
                    if (work == 1 && social == 1 && other == 1) {
                      if (num == 1) {
                        Message.success("保存成功");
                        this.activeName = "third";
                      } else {
                        Message.success("保存成功");
                      }
                    }
                  })
                  .catch((error) => {
                    console.error("提交失败:", error);
                    // 在这里添加错误处理逻辑
                  });
              }
            } else {
              Message.error("主要工作经历未填写完成!");
            }
          } else {
            // 如果验证失败，可以在这里处理
            console.log("Validation failed");
            // 执行其他操作...
            if (this.other.researchResults == "") {
              Message.error("本人专业领域以及研究成果未填写！");
            } else if (this.other.projectConsultation == "") {
              Message.error("本人参加过何种项目咨询、审查、论证等事项未填写！");
            }
          }
        });
      } catch (error) {
        // 捕获并处理异常
        console.error("An error occurred during validation:", error);
        // 可以在这里添加更多的错误处理逻辑...
      }
    },
    saveonlypdf(type) {
      function logFormData(formData) {
        console.log("FormData内容如下：");
        for (let pair of formData.entries()) {
          console.log(pair[0] + ":", pair[1]);
        }
      }

      console.log(this.files);

      // 假设这是你的文件对象
      const files = {
        idCard: this.files.idCard,
        certificate: this.files.certificate,
        qualification: this.files.qualification,
        supportMater: this.files.supportMater,
        applicationForm: this.files.applicationForm,
      };

      const formData = new FormData();
      const placeholderFile = new Blob([""], {
        type: "application/octet-stream",
      });
      placeholderFile.name = "placeholder.txt"; // 给Blob对象命名

      // 遍历所有可能的文件项
      Object.keys(files).forEach((fileKey) => {
        if (fileKey === type && files[fileKey]) {
          // 如果当前文件项匹配type且存在，则添加到formData
          formData.append(fileKey, files[fileKey]);
          console.log(`${fileKey} 已添加`, files[fileKey]);
        } else if (!files[fileKey]) {
          // 如果文件不存在，添加一个占位符文件
          formData.append(fileKey, placeholderFile, "");
          // console.log(`${fileKey} 未添加或为空`);
        } else {
          formData.append(fileKey, placeholderFile, "");
          // console.log(`${fileKey} 类型不匹配，跳过`);
        }
      });

      // 获取 expertId
      // const expertId = localStorage.getItem("expertid");
      const expertId = this.expertid;

      if (expertId) {
        console.log("expertId 已添加", expertId);
      } else {
        console.log("expertId 未添加或为空");
      }

      // 查看 FormData 内容
      logFormData(formData);
      typeof formData;
      console.log(typeof formData);
      // 发送请求
      // 记录请求开始的时间
      const startTime = Date.now();
      const a = true;
      // const timeout = setTimeout(() => {
      //   console.log("两秒后");
      //   // if (a) {
      //   //
      //   // }
      //   this.loading = false; // 隐藏加载圈
      //   Message.success("保存成功"); // 强制显示成功消息

      //   // if (remainingTime > 0) {
      //   //   Message.success("保存成功"); // 强制显示成功消息
      //   // }
      // }, 2000);
      http
        .post(`/admin/expertAttach/addOrUpdate/${expertId}`, formData, {
          headers: {
            "Content-Type": "multipart/form-data", // 注意：实际上不需要手动设置这个头部，浏览器会自动设置
          },
        })
        .then((response) => {
          console.log("expertid", expertId);
          console.log("成功响应:", response.data);
          // a = false
          // if(!a){
          //   Message.success("保存成功");
          // }
          if (response.data.code == 0) {
            Message.error(response.data.msg);
            // this.$message.error(response.data.msg);
          } else {
            Message.success("上传成功");
            this.selectpdf();
            // this.$message.success("保存成功");
          }
          // this.loading = false; // 隐藏加载圈

          // clearTimeout(timeout);
          // this.loading = false; // 显示加载圈
          // this.formLabelAlign = response.data.data;
          // 发送请求
          console.log(expertId);
          console.log(response.data.data);
          this.selectpdf;
          // 查询数据
        })
        .catch((error) => {
          console.error("错误:", error);
          // 处理错误
          this.loading = false; // 显示加载圈
          // Message.error(error)
          // Message.error("error");
        });
    },
    savethree() {
      this.loading = true; // 显示加载圈
      function logFormData(formData) {
        console.log("FormData内容如下：");
        for (let pair of formData.entries()) {
          console.log(pair[0] + ":", pair[1]);
        }
      }

      console.log(this.files);
      // 假设这是你的文件对象
      const files = {
        idCard: this.files.idCard, // 替换为实际的文件对象
        certificate: this.files.certificate,
        qualification: this.files.qualification,
        supportMater: this.files.supportMater,
        applicationForm: this.files.applicationForm,
      };

      const formData = new FormData();
      const placeholderFile = new Blob([""], {
        type: "application/octet-stream",
      });
      placeholderFile.name = "placeholder.txt"; // 给Blob对象命名
      // 添加各个文件
      if (files.idCard) {
        formData.append("idCard", files.idCard);
        console.log("idCard 已添加", files.idCard);
      } else {
        formData.append("idCard", placeholderFile, "");
        console.log("idCard 未添加或为空");
      }

      if (files.certificate) {
        formData.append("certificate", files.certificate);
        console.log("certificate 已添加", files.certificate);
      } else {
        formData.append("certificate", placeholderFile, "");
        console.log("certificate 未添加或为空");
      }

      if (files.qualification) {
        formData.append("qualification", files.qualification);
        console.log("qualification 已添加", files.qualification);
      } else {
        formData.append("qualification", placeholderFile, "");

        console.log("qualification 未添加或为空");
      }

      if (files.supportMater) {
        formData.append("supportMater", files.supportMater);
        console.log("supportMater 已添加", files.supportMater);
      } else {
        formData.append("supportMater", placeholderFile, "");

        console.log("supportMater 未添加或为空");
      }

      if (files.applicationForm) {
        formData.append("applicationForm", files.applicationForm);
        console.log("applicationForm 已添加", files.applicationForm);
      } else {
        formData.append("applicationForm", placeholderFile, "");
        console.log("applicationForm 未添加或为空");
      }

      // 获取 expertId
      // const expertId = localStorage.getItem("expertid");
      const expertId = this.expertid;

      if (expertId) {
        console.log("expertId 已添加", expertId);
      } else {
        console.log("expertId 未添加或为空");
      }

      // 查看 FormData 内容
      logFormData(formData);
      typeof formData;
      console.log(typeof formData);
      // 发送请求
      // 记录请求开始的时间
      const startTime = Date.now();
      const a = true;
      // const timeout = setTimeout(() => {
      //   console.log("两秒后");
      //   // if (a) {
      //   //
      //   // }
      //   this.loading = false; // 隐藏加载圈
      //   Message.success("保存成功"); // 强制显示成功消息

      //   // if (remainingTime > 0) {
      //   //   Message.success("保存成功"); // 强制显示成功消息
      //   // }
      // }, 2000);
      http
        .post(`/admin/expertAttach/addOrUpdate/${expertId}`, formData, {
          headers: {
            "Content-Type": "multipart/form-data", // 注意：实际上不需要手动设置这个头部，浏览器会自动设置
          },
        })
        .then((response) => {
          console.log("expertid", expertId);
          console.log("成功响应:", response.data);
          // a = false
          // if(!a){
          //   Message.success("保存成功");
          // }
          if (response.data.code == 0) {
            Message.error(response.data.msg);
            // this.$message.error(response.data.msg);
          } else {
            Message.success("保存成功");
            // this.$message.success("保存成功");
          }
          this.loading = false; // 隐藏加载圈

          // clearTimeout(timeout);
          // this.loading = false; // 显示加载圈
          // this.formLabelAlign = response.data.data;
          // 发送请求
          console.log(expertId);
          console.log(response.data.data);
          this.selectpdf;
          // 查询数据
        })
        .catch((error) => {
          console.error("错误:", error);
          // 处理错误
          this.loading = false; // 显示加载圈
          // Message.error(error)
          // Message.error("error");
        });
      // .finally(() => {
      //   // // 设置一个定时器，确保至少等待5秒
      //   // const elapsed = Date.now() - startTime;
      //   // const remainingTime = Math.max(2000 - elapsed, 0);
      //   console.log(123456);
      // });
    },
    formatDate(date) {
      // 创建一个新的Date对象，避免修改原始数据
      const formattedDate = new Date(date);

      // 获取年、月、日
      const year = formattedDate.getFullYear().toString(); // 取年份的后两位
      const month = String(formattedDate.getMonth() + 1).padStart(2, "0"); // 月份从0开始，所以需要加1，并确保是两位数
      const day = String(formattedDate.getDate()).padStart(2, "0"); // 确保是两位数

      // 返回格式化后的日期
      return `${year}-${month}-${day}`;
    },
    backone() {
      this.canSwitchTabs = true; // 设置允许切换标志为true
      this.selectbasic();
      this.activeName = "first";
    },
    backtwo() {
      this.canSwitchTabs = true; // 设置允许切换标志为true
      this.selectwork();
      this.selectother();
      this.selectsocial();
      this.activeName = "second";
    },
    nextone() {
      const num = 0;
      this.submitonlyForm("formRef")
        .then((res) => {
          // console.log(this.activeName);
          this.canSwitchTabs = true; // 设置允许切换标志为true
          // console.log(this.canSwitchTabs);
          // console.log("formLabelAlign", this.formLabelAlign);
          if (!this.formLabelAlign.fillStatus) {
            // Message.success("进行更新");
            // this.savetwo();
            // this.selectbasic();
            // localStorage
            // const expertid = localStorage.getItem("expertid");
            const expertid = this.expertid;
            console.log(expertid);
            this.submitonlyForm("formRef")
              .then((res) => {
                console.log(num);
                this.saveoneflag = false;
                const formData = { ...this.formLabelAlign }; // 复制当前表单数据
                console.log(this.formLabelAlign);
                console.log(formData.primaryMajor);
                console.log(formData.secondMajor);
                console.log(formData.thirdMajor);
                console.log(formData.fourthMajor);
                console.log(formData.fifthMajor);
                const a = formData.primaryMajor.join("/");
                formData.primaryMajor = a;
                const b = formData.secondMajor.join("/");
                formData.secondMajor = b;
                const c = formData.thirdMajor.join("/");
                formData.thirdMajor = c;
                const d = formData.fourthMajor.join("/");
                formData.fourthMajor = d;
                const e = formData.fifthMajor.join("/");
                formData.fifthMajor = e;
                // this.photourl
                console.log(this.photourl);
                formData.photoUrl = this.photourl;
                // console.log('formLabelAlign',this.formLabelAlign);
                // const id = localStorage.getItem('usrid')
                // // 如果需要，可以在这里对formData进行预处理，例如格式化日期等
                // console.log(id);
                // console.log(formData);
                // 处理日期
                // console.log(this.basephoto);
                // formData.photoUrl = this.basephoto;
                formData.nativePlace =
                  formData.nativePlace[0] + "/" + formData.nativePlace[1];
                // console.log('formData',formData.nativePlace);
                // console.log('formData', formData);
                // 处理boolen值
                // console.log(this.expertid);
                formData.birthDate = this.formatDate(formData.birthDate);
                console.log(formData.birthDate);
                if (this.expertid == null) {
                  console.log(123456);
                }

                // let expertid = localStorage.getItem("expertid");
                // console.log(expertid);
                // console.log(typeof expertid);
                // expertid = Number(expertid);
                console.log(this.flagfirst);
                // if (this.flagfirst == 1) {
                //   console.log("修改");
                //   http
                //     .get(`/expertBasicInfo/get/${expertid}`, formData, {
                //       headers: {
                //         "Content-Type": "application/json",
                //       },
                //     })
                //     .then((response) => {
                //       // console.log(提交数据);
                //       console.log("查询成功:", response.data.data);
                //       formData.id = response.data.data.id;
                //       // localStorage.setItem('expertid', response.data.data)

                //       // 可以在此处添加成功后的逻辑，如提示用户、重置表单等
                //     })
                //     .catch((error) => {
                //       console.error("提交失败:", error);
                //       // 错误处理逻辑
                //     });
                // } else {

                http
                  .post(`/admin/expertBasicInfo/addOrUpdate`, formData, {
                    headers: {
                      "Content-Type": "application/json",
                    },
                  })
                  .then((response) => {
                    console.log(response.data.code);

                    if (num == 0) {
                      if (response.data.code == 0) {
                        Message.error(response.data.msg);
                      } else {
                        this.selectbasic();
                        console.log("更新", response);
                        Message.success("保存成功");
                        this.activeName = "second"; // 手动切换到下一个标签页
                        this.selectwork();
                        this.selectsocial();
                        this.selectother();
                      }
                    }

                    // console.log("提交成功:", response.data.data);
                    this.flagfirst = 1;
                    // this.expertid = response.data.data
                    // localStorage.setItem("expertid", response.data.data);
                    this.expertid = response.data.data;
                    this.formLabelAlign.id = this.expertid;
                    console.log("xxxxxxxxxxxxx", this.expertid);

                    // 可以在此处添加成功后的逻辑，如提示用户、重置表单等
                  })
                  .catch((error) => {
                    console.error("提交失败:", error);
                    // 错误处理逻辑
                  });
              })
              .catch((err) => {
                console.error("提交失败:", err.message || err);
                this.$message.error(err.message || "表单验证未通过"); // 使用弹窗提示错误
              });
          }
        })
        .catch((err) => {
          console.error("提交失败:", err.message || err);
          this.$message.error(err.message || "表单验证未通过"); // 使用弹窗提示错误
        });

      // this.selectbasic();
      // console.log("formLabelAlign", this.formLabelAlign);
      // this.saveone();
    },
    nexttwo() {
      this.$refs.other
        .validate((valid) => {
          if (valid) {
            // 验证成功后的逻辑
            console.log("Validation succeeded222");
            const a =
              this.tableData.length === 0 || this.tableData[0].position == "";
            console.log(a);
            if (!a) {
              this.canSwitchTabs = true; // 设置允许切换标志为true
              if (!this.formLabelAlign.fillStatus) {
                // Message.success("保存成功");
                this.savetwo(1);
                this.selectpdf();
              }
              // this.activeName = "third";
            } else {
              Message.error("主要工作经历未填写完成!");
            }
          } else {
            // 验证失败后的逻辑
            console.log("Validation failed");
            if (this.other.researchResults == "") {
              Message.error("本人专业领域以及研究成果未填写！");
            } else {
              Message.error("本人参加过何种项目咨询、审查、论证等事项未填写！");
            }
          }
        })
        .catch((error) => {
          // 捕获并处理验证过程中出现的异常
          console.error("An error occurred during validation:", error);
        });
    },
    submitForm(formName) {
      return new Promise((resolve, reject) => {
        this.$refs[formName].validate((valid) => {
          console.log(this.formLabelAlign.photoUrl == "");

          console.log(this.Photo != "data:image/jpeg;base64,");
          let a = valid;
          const b =
            this.tableData.length === 0 || this.tableData[0].position == "";
          if (valid) {
            // alert('提交成功!');
            this.$refs.other.validate((valid) => {
              if (valid) {
                console.log(valid);
                console.log(this.FFive.name.length);
                console.log(this.FFour.name.length);
                // this.FThree.name.length != 0 &&
                if (
                  this.FFive.name.length != 0 &&
                  this.FFour.name.length != 0 &&
                  this.FTwo.name.length != 0 &&
                  this.FOne.name.length != 0
                ) {
                  if (
                    this.Photo != "data:image/jpeg;base64," &&
                    this.Photo != ""
                  ) {
                    if (!b) {
                      resolve(true); // 表示验证通过
                    } else {
                      Message.warning(
                        "工作履历中主要工作经历出现了问题！请检查"
                      );
                    }
                    // console.log(this.Photo);
                  } else {
                  }
                } else {
                  // 构建缺少的文件列表
                  let missingFiles = "";
                  if (this.FOne.name.length == 0) {
                    missingFiles += "身份证正反面<br><br>";
                  }
                  if (this.FTwo.name.length == 0) {
                    missingFiles += "最高学历（学位）证书及技术职称<br><br>";
                  }
                  // if (this.FThree.name.length == 0) {
                  //   missingFiles += "职业资格<br><br>";
                  // }
                  if (this.FFour.name.length == 0) {
                    missingFiles +=
                      "个人研究成果、工作成就、参与评审项目等相关证明材料<br><br>";
                  }
                  if (this.FFive.name.length == 0) {
                    missingFiles +=
                      "陕西省水利厅专家入库申请表(签字盖章)<br><br>";
                  }

                  // 移除最后一个多余的 <br> 标签
                  if (missingFiles.endsWith("<br>")) {
                    missingFiles = missingFiles.slice(0, -4);
                  }

                  // 添加最终提示信息
                  missingFiles += "<br>文件上传不能为空";

                  // 使用 this.$message 显示警告信息，并确保支持 HTML 内容
                  this.$message({
                    dangerouslyUseHTMLString: true,
                    message: missingFiles,
                    type: "warning",
                  });

                  reject(false); // 表示验证失败
                }
              } else {
                Message.warning("工作履历中的数据出现了问题！请检查");
                reject(false); // 表示验证失败
              }
            });
          } else {
            Message.warning("基本信息数据有错误！请检查数据");
            reject(false); // 表示验证失败
          }
        });
      });
    },
    submitonlyForm(formName) {
      return new Promise((resolve, reject) => {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            console.log(this.formLabelAlign.primaryMajor);
            console.log(this.formLabelAlign.secondMajor);
            console.log(this.formLabelAlign.thirdMajor);
            console.log(this.formLabelAlign.fourthMajor);
            console.log(this.formLabelAlign.fifthMajor);
            // const majors = [
            //   this.formLabelAlign.primaryMajor,
            //   this.formLabelAlign.secondMajor,
            //   this.formLabelAlign.thirdMajor,
            //   this.formLabelAlign.fourthMajor,
            //   this.formLabelAlign.fifthMajor,
            // ];
            const majors = [
              this.formLabelAlign.primaryMajor,
              this.formLabelAlign.secondMajor,
              this.formLabelAlign.thirdMajor,
              this.formLabelAlign.fourthMajor,
              this.formLabelAlign.fifthMajor,
            ];
            console.log(majors);
            const result = majors.map((item) =>
              Array.isArray(item) ? item.join("/") : item
            );
            console.log(result);

            // 使用一个数组来临时存储去除"其他"之后的专业列表
            let filteredMajors = [];
            result.forEach((major) => {
              if (major !== "无") {
                filteredMajors.push(major);
              }
            });
            const otherCount = result.filter((major) => major === "无").length;
            // 使用Set去除重复项并检查长度是否一致
            const uniqueMajors = new Set(filteredMajors);
            // // 使用一个数组来临时存储去除"其他"之后的专业列表
            // let filteredMajors = [];

            // majors.forEach((major) => {
            //   if (major !== "无") {
            //     filteredMajors.push(major);
            //   }
            // });

            // // 使用Set去除重复项并检查长度是否一致
            // const uniqueMajors = new Set(filteredMajors);

            // 如果有照片URL检查条件
            if (this.Photo !== "data:image/jpeg;base64," && this.Photo !== "") {
              // 检查去重后的专业数量加上"无"的数量是否等于5
              const otherCount = result.filter(
                (major) => major === "无"
              ).length;
              if (uniqueMajors.size + otherCount === 5) {
                resolve(true); // 表示验证通过
              } else {
                console.log("uniqueMajors.size", uniqueMajors.size);
                console.log("otherCount", otherCount);
                reject(new Error("专业有重复"));
              }
            } else {
              reject(new Error("缺少有效的图片")); // 或者可以根据需要调整错误信息
            }
          } else {
            console.log("未通过");
            reject(new Error("表单验证未通过")); // 提供更有意义的错误信息
          }
        });
      });
    },
    submitonlyWork(formName) {
      return new Promise((resolve, reject) => {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            console.log(this.formLabelAlign.primaryMajor);
            console.log(this.formLabelAlign.secondMajor);
            console.log(this.formLabelAlign.thirdMajor);
            console.log(this.formLabelAlign.fourthMajor);
            console.log(this.formLabelAlign.fifthMajor);
            const majors = [
              this.formLabelAlign.primaryMajor,
              this.formLabelAlign.secondMajor,
              this.formLabelAlign.thirdMajor,
              this.formLabelAlign.fourthMajor,
              this.formLabelAlign.fifthMajor,
            ];

            // 使用一个数组来临时存储去除"其他"之后的专业列表
            let filteredMajors = [];

            majors.forEach((major) => {
              if (major !== "无") {
                filteredMajors.push(major);
              }
            });

            // 使用Set去除重复项并检查长度是否一致
            const uniqueMajors = new Set(filteredMajors);

            // 如果有照片URL检查条件
            if (this.Photo !== "data:image/jpeg;base64," && this.Photo !== "") {
              // 检查去重后的专业数量加上"无"的数量是否等于5
              const otherCount = majors.filter(
                (major) => major === "无"
              ).length;
              if (uniqueMajors.size + otherCount === 5) {
                resolve(true); // 表示验证通过
              } else {
                reject(new Error("专业有重复"));
              }
            } else {
              reject(new Error("缺少有效的图片")); // 或者可以根据需要调整错误信息
            }
          } else {
            console.log("未通过");
            reject(new Error("表单验证未通过")); // 提供更有意义的错误信息
          }
        });
      });
    },
    nextthree() {
      // 使用 Element UI 的 MessageBox 作为确认对话框
      this.$confirm("提交后不可再修改，是否确认提交？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          // 用户点击了“确定”按钮后执行这里的代码
          this.submitForm("formRef")
            .then((res) => {
              console.log(res);
              console.log("表单验证通过");
              this.loading = true;

              function logFormData(formData) {
                console.log("FormData内容如下：");
                for (let pair of formData.entries()) {
                  console.log(pair[0] + ":", pair[1]);
                }
              }

              console.log(this.files);
              // 假设这是你的文件对象
              const files = {
                idCard: this.files.idCard, // 替换为实际的文件对象
                certificate: this.files.certificate,
                qualification: this.files.qualification,
                supportMater: this.files.supportMater,
                applicationForm: this.files.applicationForm,
              };

              const formData = new FormData();
              const placeholderFile = new Blob([""], {
                type: "application/octet-stream",
              });
              placeholderFile.name = "placeholder.txt"; // 给Blob对象命名

              // 添加各个文件
              if (files.idCard) {
                formData.append("idCard", files.idCard);
                console.log("idCard 已添加", files.idCard);
              } else {
                formData.append("idCard", placeholderFile, "");
                console.log("idCard 未添加或为空");
              }

              if (files.certificate) {
                formData.append("certificate", files.certificate);
                console.log("certificate 已添加", files.certificate);
              } else {
                formData.append("certificate", placeholderFile, "");
                console.log("certificate 未添加或为空");
              }

              if (files.qualification) {
                formData.append("qualification", files.qualification);
                console.log("qualification 已添加", files.qualification);
              } else {
                formData.append("qualification", placeholderFile, "");
                console.log("qualification 未添加或为空");
              }

              if (files.supportMater) {
                formData.append("supportMater", files.supportMater);
                console.log("supportMater 已添加", files.supportMater);
              } else {
                formData.append("supportMater", placeholderFile, "");
                console.log("supportMater 未添加或为空");
              }

              if (files.applicationForm) {
                formData.append("applicationForm", files.applicationForm);
                console.log("applicationForm 已添加", files.applicationForm);
              } else {
                formData.append("applicationForm", placeholderFile, "");
                console.log("applicationForm 未添加或为空");
              }

              // 获取 expertId
              const expertId = this.expertid;
              if (expertId) {
                console.log("expertId 已添加", expertId);
              } else {
                console.log("expertId 未添加或为空");
              }

              // 查看 FormData 内容
              logFormData(formData);
              typeof formData;
              console.log(typeof formData);
              const startTime = Date.now();

              // 发送请求
              http
                .post(`/admin/expertFinal/addOrUpdate`, formData, {
                  headers: {
                    "Content-Type": "multipart/form-data",
                  },
                })
                .then((response) => {
                  console.log("expertid", expertId);
                  console.log(response);
                  console.log(response.code);
                  if (response.data.code == 0) {
                    this.$message.error(response.data.msg);
                  } else {
                    this.$message.success("保存成功");
                  }
                  this.loading = false; // 隐藏加载圈
                  window.location.reload();
                })
                .catch((error) => {
                  console.error("错误:", error);
                  this.loading = false; // 确保在出错时也隐藏加载圈
                  // Message.error(error.msg)
                });
            })
            .catch((err) => {
              console.log("表单验证失败");
              console.log(err);
              // 可以在这里添加其他处理逻辑
            });
        })
        .catch(() => {
          // 用户点击了“取消”按钮后执行这里的代码
          this.$message({
            type: "info",
            message: "已取消提交",
          });
        });
      // Message.success("成功提交到服务器");
    },
    goToNextStep() {
      // Handle "下一步" logic here
      console.log(this.formData);
    },
    exit() {
      http
        .post("/admin/user/logout")
        .then((res) => {
          if (res.data.code === 1) {
            this.$message.success("退出成功");
            localStorage.removeItem("token");
            this.expertname = ''
            this.formLabelAlign={
        id: "",
        name: "",
        gender: "",
        expertId: "",
        ethnicity: "",
        birthDate: "",
        idCard: "",
        nativePlace: "",
        politicalStatus: "",
        healthStatus: "",
        education: "",
        graduateSchool: "",
        workUnit: "",
        belong: "",
        job: "",
        title: "",
        isPublicOfficial: "",
        phone: "",
        email: "",
        bankName: "",
        bankAccount: "",
        photoUrl: "",
        primaryMajor: "",
        secondMajor: "",
        thirdMajor: "",
        fourthMajor: "",
        fifthMajor: "",
        registeredQualification: "",
        workTime: "",
        isAcademic: "",
        isDesignMaster: "",
        isSubsidy: "",
        isSpecial: "",
        auditOpinion: "",
        auditStatus: "待审核",
      },
            this.$router.push("/home");
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
    handleClickeltab(tab, event) {
      switch (tab.name) {
        case "first":
          this.selectbasic();
          break;
        case "second":
          this.selectother();
          this.selectwork();
          this.selectsocial();
          break;
        case "third":
          this.selectpdf();
          break;
        case "forth":
          // this.selectpdf();
          console.log("第四页");
          break;
        default:
          console.log("未知标签页");
      }
    },
    handleRemove(file) {
      console.log(file);
    },
    beforeLeaveTab(activeName, oldActiveName) {
      console.log("activeName", activeName);
      console.log("oldActiveName", oldActiveName);

      if (!this.canSwitchTabs && oldActiveName !== activeName) {
        // 如果不允许切换且试图直接通过点击标签进行跳转，则阻止
        return false;
      }

      // 重置标志位
      this.canSwitchTabs = false;

      // 其他逻辑，例如表单验证等
      return true; // 允许切换
    },
    handlePreview(file) {
      console.log(file);
    },
    beforeRemove(file) {
      // return this.$confirm(`确定移除 ${file.name}？`);
    },
    handlePictureCardPreview(file) {
      this.dialogphotoUrl = file.url;
      this.dialogVisible = true;
    },
    handleAvatarSuccess(res, file) {
      // 关闭上传图片
      // console.log("成功了");
      // this.formLabelAlign.photoUrl = URL.createObjectURL(file.raw);
      // console.log(this.formLabelAlign.photoUrl);
    },
    handleChange(file) {
      // // 直接使用新选择的文件更新显示
      // // console.log(file);
      // // this.formLabelAlign.photoUrl = URL.createObjectURL(file.raw);
      // // this.customUpload()
      // // 更新照片预览
      // this.Photo = URL.createObjectURL(file.raw);

      // // 设置表单字段值
      // this.formLabelAlign.photoUrl = file.raw;

      // // 手动触发验证
      // this.$refs['formRef'].validateField('photoUrl');


      // 关闭图片上传
      // if (this.beforeUploadimg(file.raw)) {
      //   // 在这里进行文件验证
      //   this.customUpload(file.raw); // 如果验证通过，则直接上传
      // }
    },
    // handleFileChange(index) {
    //   console.log(this.uploadUrl);
    //   console.log(index);
    //   // let ab = localStorage.getItem('expertid')
    //   // console.log(ab);
    //   // this.uploadUrl = `http://localhost:8024/admin/common/${ab}`;
    //   const a = (file, fileList) =>
    //     this.handleFileChange(file, fileList, index);
    //   //   console.log(a);
    //   return a;
    // },
    beforeUploadidcard(file) {
      const isPDF = file.type === "application/pdf";
      const isLt20M = file.size / 1024 / 1024 < 20;
      this.fileflag = 0;
      if (!isPDF) {
        this.fileflag = 1;

        this.$message.error("只能上传PDF文件");
        return false; // 阻止上传
      }
      if (!isLt20M) {
        this.fileflag = 1;

        this.$message.error("上传文件大小不能超过20MB");
        return false; // 阻止上传
      }

      // 如果文件符合要求，则允许上传
      return true;
    },
    // handleFileChange(file, fileList, index) {
    //   this.expertid = localStorage.getItem("expertid");
    // //   console.log(this.expertid);
    // //   console.log("fileflag", this.fileflag);
    // //   this.uploadUrl = `http://localhost:8024/expertAttach/addOrUpdate/${this.expertId}`;
    //   console.log(index);
    //   if (this.fileflag == 0) {
    //     // 根据index更新对应的fileList
    //     console.log(123);
    //     switch (index) {
    //       case 1:
    //         this.first = true;
    //         this.fileone = [file]; // 直接替换整个数组而不是先清空再添加
    //         break;
    //       case 2:
    //         this.second = true;
    //         this.filetwo = [file];
    //         break;
    //       case 3:
    //         this.third = true;
    //         this.filethree = [file];
    //         break;
    //       case 4:
    //         this.forth = true;
    //         this.filefour = [file];
    //         break;
    //       case 5:
    //         this.fifth = true;
    //         this.filefive = [file];
    //         break;
    //     }
    //   }

    // //   console.log(222);
    // //   console.log(file, fileList, index);
    // },
    handleFileChange(type) {
      return (file, fileList) => {
        console.log(file);
        console.log(file.name);
        const ispdf = file.name.toLowerCase().endsWith(".pdf");
        console.log(ispdf);

        if (ispdf) {
          // 清理旧文件信息
          switch (type) {
            case "idCard":
              const size = file.size / 1024 / 1024 <= 5;
              if (size) {
                this.remove(type);
                this.FOne = { name: "", url: "" };
                this.FOne.name = file.name;
                console.log("idCard");
                this.files[type] = file.raw;
                console.log(`${type} 文件已选择`);
                this.saveonlypdf(type);
              } else {
                // this.FOne = { name: "", url: "" };
                // this
                this.remove("idCard");
                Message.error("文件大小超过5M");
              }
              break;
            case "certificate":
              const size1 = file.size / 1024 / 1024 <= 10;
              if (size1) {
                this.remove(type);
                this.FTwo = { name: "", url: "" };
                this.FTwo.name = file.name;
                console.log("certificate");
                this.files[type] = file.raw;
                console.log(`${type} 文件已选择`);
                this.saveonlypdf(type);
              } else {
                // this.FTwo = { name: "", url: "" };
                this.remove("certificate");

                Message.error("文件大小超过10M");
              }
              break;
            case "qualification":
              const size2 = file.size / 1024 / 1024 <= 10;
              if (size2) {
                this.remove(type);
                this.FThree = { name: "", url: "" };
                this.FThree.name = file.name;
                console.log("qualification");
                this.files[type] = file.raw;
                console.log(`${type} 文件已选择`);
                this.saveonlypdf(type);
              } else {
                this.remove("qualification");

                Message.error("文件大小超过10M");
              }
              break;
            case "supportMater":
              const size3 = file.size / 1024 / 1024 <= 25;
              if (size3) {
                this.remove(type);
                console.log(this.FFour);
                this.FFour = { name: "", url: "" };
                console.log("supportMater");

                this.FFour.name = file.name;
                this.files[type] = file.raw;
                console.log(`${type} 文件已选择`);
                this.saveonlypdf(type);
              } else {
                this.remove("supportMater");

                Message.error("文件大小超过25M");
              }
              break;
            case "applicationForm":
              const size4 = file.size / 1024 / 1024 <= 5;
              if (size4) {
                this.remove(type);
                this.FFive = { name: "", url: "" };
                this.FFive.name = file.name;
                console.log("applicationForm");
                this.files[type] = file.raw;
                console.log(`${type} 文件已选择`);
                this.saveonlypdf(type);
              } else {
                this.remove("applicationForm");

                Message.error("文件大小超过5M");
              }
              break;
          }
        } else {
          console.log(type);
          this.remove(type);
          Message.error("上传的文件不是pdf文件");
        }
      };
    },
    addRow() {
      this.tableData.push({
        id: null,
        expertId: null,
        orgName: "",
        startDate: "",
        endDate: "",
        title: "",
        position: "",
        createTime: "",
        updateTime: "",
      });
      this.isTillNow.push(false)
    },
    handleSelectionChange(selection) {
      this.selectedRows = selection;
      console.log("在选择数据");
      console.log(this.selectedRows);
    },
    deleteSelectedRows() {
      console.log(this.isTillNow);
      // 找到所有将要被删除的行
      console.log(this.tableData);
      const old = this.tableData;
      const deletedRows = this.tableData.filter((row) =>
        this.selectedRows.includes(row)
      );
      const deletedRowsIndices = this.tableData.reduce((indices, currentRow, index) => {
  if (this.selectedRows.includes(currentRow)) {
    indices.push(index); // 仅保存索引
  }
  return indices;
}, []);
      // 如果对象引用相同可以直接使用此方法
      const notDeletedRows = this.tableData.filter(
        (row) => !this.selectedRows.includes(row)
      );
      console.log("notDeletedRows", notDeletedRows);
      console.log("deletedRows", deletedRows);
      //   console.log('deletedRows',deletedRows);
      const deleteArr = [];
      for (let i = 0; i < deletedRows.length; i++) {
        const a = Number(deletedRows[i].id); // 将 ID 转换为数字
        if (!isNaN(a)) {
          // 确保转换成功
          deleteArr.push(a);
        }
      }
      console.log("Deleted Rows:", deleteArr);

      // 将数组转换为以逗号分隔的字符串
      const idsParam = deleteArr.join(",");
      console.log("IDs Parameter:", idsParam);

      // 手动构建URL并发送删除请求
      const url = `http://localhost:8024/admin/expertWorkExper/delete?ids=${encodeURIComponent(
        idsParam
      )}`;

      http
        .delete(
          `/admin/expertWorkExper/delete?ids=${encodeURIComponent(idsParam)}`,
          {
            headers: {
              "Content-Type": "application/json",
            },
          }
        )
        .then((response) => {
          console.log(deleteArr);

          console.log("删除成功:", response.data);
          Message.success("删除成功");
          console.log(deleteArr);
          //   // 更新前端显示的数据
          //   this.tableData = this.tableData.filter(
          //     (item) => !deleteArr.includes(item.id)
          //   );
          //   this.selectwork();
          // console.log(this.tableData);
          this.tableData = notDeletedRows;
          const newIsTillNow = this.isTillNow.filter((_, index) => !deletedRowsIndices.includes(index));

// 如果你想更新原来的数组
this.isTillNow = newIsTillNow;

          console.log('删除索引work',deletedRowsIndices);
          console.log('最终数据work',this.isTillNow);
        })
        .catch((error) => {
          console.error(
            "提交失败:",
            error.response ? error.response.data : error.message
          );
          Message.error("删除失败"); // 更正为错误提示
        });
      //   // 更新 tableData，移除选中的行
      //   this.tableData = this.tableData.filter(
      //     (row) => !this.selectedRows.includes(row)
      //   );
    },
    addRow1() {
      this.tableData1.push({
        id: null,
        expertId: null,
        orgName: "",
        startDate: "",
        endDate: "",
        title: "",
        position: "",
        createTime: "",
        updateTime: "",
      });
      this.isTillNow1.push(false)
    },
    handleSelectionChange1(selection) {
      console.log(this.selectedRows1.length);
      this.selectedRows1 = selection;
      console.log(this.selectedRows1.length);
    },
    deleteSelectedRows1() {
      // 找到所有将要被删除的行
      const deletedRows = this.tableData1.filter((row) =>
        this.selectedRows1.includes(row)
      );
      const deletedRowsIndices = this.tableData1.reduce((indices, currentRow, index) => {
  if (this.selectedRows1.includes(currentRow)) {
    indices.push(index); // 仅保存索引
  }
  return indices;
}, []);
console.log(deletedRowsIndices);
      // 找到所有将要被删除的行
      const notDeletedRows = this.tableData1.filter(
        (row) => !this.selectedRows1.includes(row)
      );
      const deleteArr = [];
      for (let i = 0; i < deletedRows.length; i++) {
        console.log(deletedRows[i].id);
        const a = Number(deletedRows[i].id); // 将 ID 转换为数字
        if (!isNaN(a)) {
          // 确保转换成功
          deleteArr.push(a);
        }
      }
      console.log("Deleted Rows:", deleteArr);

      // 将数组转换为以逗号分隔的字符串
      const idsParam = deleteArr.join(",");
      console.log("IDs Parameter:", idsParam);

      // 手动构建URL并发送删除请求
      // const url = `http://localhost:8024}`;

      http
        .delete(
          `/admin/expertSocialPart/delete?ids=${encodeURIComponent(idsParam)}`,
          {
            headers: {
              "Content-Type": "application/json",
            },
          }
        )
        .then((response) => {
          console.log("deleteArr", deleteArr);
          console.log("删除成功:", response.data);
          Message.success("删除成功");
          console.log(deleteArr);
          //   // 更新前端显示的数据
          //   this.tableData1 = this.tableData1.filter(
          //     (item) => !deleteArr.includes(item.id)
          //   );
          this.tableData1 = notDeletedRows;
          console.log(this.tableData1);
          console.log(this.selectedRows1)
          // deletedRows
          // deletedRowsIndices
          // 使用 filter 创建一个新的数组，排除掉 deletedRowsIndices 中指定的索引
const newIsTillNow1 = this.isTillNow1.filter((_, index) => !deletedRowsIndices.includes(index));

// 如果你想更新原来的数组
this.isTillNow1 = newIsTillNow1;

          console.log('删除索引',deletedRowsIndices);
          console.log('最终数据',this.isTillNow1);
        })
        .catch((error) => {
          console.error(
            "提交失败:",
            error.response ? error.response.data : error.message
          );
          Message.error("删除失败"); // 更正为错误提示
        });
    },
    successsubmit() {
      console.log(123);
    },
    selectwork() {
      // const expertid = localStorage.getItem("expertid");
      const expertid = this.expertid;
      const usrid = localStorage.getItem("usrid");
      console.log("expertid", expertid);
      http
        .get(`/admin/expertWorkExper/get/${expertid}`, {
          headers: {
            "Content-Type": "application/json",
          },
        })
        .then((response) => {
          console.log("work查询成功:", response);
          console.log("work查询成功:", response.data.data);
          let a = response.data.data;
          if (
            this.tableData.length === 0 ||
            (this.tableData[0].startDate == "" &&
              this.tableData[0].orgName == "" &&
              this.tableData[0].title == "")
          ) {
            if (this.formLabelAlign.fillStatus) {
              this.showworkfalse = true;
            }
          }
          console.log("123456");

          if (a.length != 0) {
            console.log("a", a);
            for (let i = 0; i < a.length; i++) {
              if (!a[i].startDate) {
                console.log(123);
              } else {
                // a[i].startDate = [
                //   new Date(a[i].startDate),
                //   new Date(a[i].endDate),
                // ];
                // console.log(a[i].startDate);
              }
            }
            this.tableData = a;
            this.tableData.forEach((_, index) => {
              this.$set(this.isTillNow, index, !this.tableData[index].endDate);
            });
          } else {
            this.tableData = [
              {
                id: null,
                expertId: null,
                orgName: "",
                startDate: "",
                endDate: "",
                title: "",
                position: "",
                createTime: "",
                updateTime: "",
              },
            ];
          }

          //   console.log(a);
          //   this.tableData = a;
          // 转换 startDate 和 endDate 到 <el-date-picker> 可接受的格式
          // 可以在此处添加成功后的逻辑，如提示用户、重置表单等
        })
        .catch((error) => {
          console.error("提交失败:", error);
          // 错误处理逻辑
        });
    },
    selectsocial() {
      // const expertid = localStorage.getItem("expertid");
      const expertid = this.expertid;
      console.log("expertid", expertid);
      const usrid = localStorage.getItem("usrid");

      http
        .get(`/admin/expertSocialPart/get/${expertid}`, {
          headers: {
            "Content-Type": "application/json",
          },
        })
        .then((response) => {
          console.log("social查询成功:", response);
          console.log("social查询成功:", response.data.data);
          let a = response.data.data;
          if (a.length != 0) {
            console.log("a", a);
            for (let i = 0; i < a.length; i++) {
              if (!a[i].startDate) {
                console.log(123);
              } else {
                // a[i].startDate = [
                //   new Date(a[i].startDate),
                //   new Date(a[i].endDate),
                // ];
                console.log(a[i].startDate);
              }
            }

            console.log(a);
            this.tableData1 = a;
            this.tableData1.forEach((_, index) => {
              this.$set(
                this.isTillNow1,
                index,
                !this.tableData1[index].endDate
              );
            });
            console.log(this.isTillNow1);
          } else {
            this.tableData1 = [
              {
                id: null,
                expertId: null,
                orgName: "",
                startDate: "",
                endDate: "",
                role: "",
                createTime: "",
                updateTime: "",
              },
            ];
            this.isTillNow1 = [];
          }

          // 转换 startDate 和 endDate 到 <el-date-picker> 可接受的格式
          // 可以在此处添加成功后的逻辑，如提示用户、重置表单等
        })
        .catch((error) => {
          console.error("提交失败:", error);
          // 错误处理逻辑
        });
    },
    getObjectURL(file) {
      let url = null;
      if (window.createObjectURL !== undefined) {
        // basic
        url = window.createObjectURL(file);
      } else if (window.webkitURL !== undefined) {
        // webkit or chrome
        try {
          url = window.webkitURL.createObjectURL(file);
        } catch (error) {
          console.log(error);
        }
      } else if (window.URL !== undefined) {
        // mozilla(firefox)
        try {
          url = window.URL.createObjectURL(file);
        } catch (error) {
          console.log(error);
        }
      }
      return url;
    },
    // download(num) {
    //   console.log(num);
    //   let url = "";
    //   let name = "";
    //   if (num == 1) {
    //     url = this.FOne.url;
    //     name = this.FOne.name;
    //   }
    //   if (num == 2) {
    //     url = this.FTwo.url;
    //     name = this.FTwo.name;
    //   }
    //   if (num == 3) {
    //     url = this.FThree.url;
    //     name = this.FThree.name;
    //   }
    //   if (num == 4) {
    //     url = this.FFour.url;
    //     name = this.FFour.name;
    //   }
    //   if (num == 5) {
    //     url = this.FFive.url;
    //     name = this.FFive.name;
    //   } // 注意这里应该是 FFive 而不是重复使用 FFour
    //   // var xhr = new XMLHttpRequest();
    //   // "get",
    //   //   "/server-api/api/system/rest/s/apply/agree-document/get?userId=" +
    //   //     this.userId,
    //   //   true;

    //   // xhr
    //   //   .open("get", `/admin/common/download/?fileUrl=${url}`, {
    //   //     responseType: "blob", // 设置响应类型为 blob 来处理二进制数据
    //   //   })
    //   //   .then((response) => {
    //   //     //   console.log(response);
    //   //     //   const blob = new Blob([response.data], {
    //   //     //     type:
    //   //     //       response.headers["content-type"] || "application/octet-stream",
    //   //     //   });
    //   //     //   const link = document.createElement("a");
    //   //     //   link.href = URL.createObjectURL(blob);
    //   //     //   link.download = "downloaded_file"; // 设置默认文件名或根据实际情况动态设置文件名
    //   //     //   document.body.appendChild(link);
    //   //     //   link.click(); // 模拟点击链接以开始下载
    //   //     //   document.body.removeChild(link); // 移除临时的链接元素，避免内存泄漏
    //   //     // })
    //   //     // .catch((error) => {
    //   //     //   console.error("下载失败：", error);
    //   //     // });
    //   //     // 创建一个临时的链接元素来触发下载
    //   //     const blob = new Blob([response.data], { type: "application/pdf" });
    //   //     const link = document.createElement("a");
    //   //     link.href = URL.createObjectURL(blob);
    //   //     link.download = name; // 设置下载文件的名字
    //   //     document.body.appendChild(link);
    //   //     link.click(); // 模拟点击链接以开始下载
    //   //     document.body.removeChild(link); // 移除临时的链接元素
    //   //   })
    //   //   .catch((error) => {
    //   //     console.error("下载失败：", error);
    //   //   });
    //   const xhr = new XMLHttpRequest();
    //   xhr.open("post", `/admin/common/download/?fileUrl=${url}`, true);
    //   // const token =
    //   const token = localStorage.getItem("token");
    //   xhr.responseType = "blob"; // 设置响应类型为 blob 来处理二进制数据

    //   xhr.onload = function () {
    //     if (xhr.status === 200) {
    //       // 获取 Content-Disposition 头部信息，从中提取文件名
    //       const contentDisposition = xhr.getResponseHeader(
    //         "content-disposition"
    //       );
    //       let fileName = name; // 默认文件名
    //       if (contentDisposition) {
    //         const regex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;
    //         const matches = regex.exec(contentDisposition);
    //         if (matches != null && matches[1]) {
    //           fileName = matches[1].replace(/['"]/g, "");
    //         }
    //       }
    //       // console.log('xhr.response',xhr.response);
    //       // 创建 Blob 对象
    //       const blob = new Blob([xhr.response], {
    //         type: xhr.getResponseHeader("Content-Type") || "application/pdf",
    //       });
    //       // console.log(blob);
    //       // 创建一个临时的链接元素来触发下载
    //       const link = document.createElement("a");
    //       link.href = URL.createObjectURL(blob);
    //       link.download = decodeURIComponent(fileName); // 设置下载文件的名字
    //       document.body.appendChild(link);
    //       link.click(); // 模拟点击链接以开始下载
    //       document.body.removeChild(link); // 移除临时的链接元素，避免内存泄漏
    //     } else {
    //       console.error("下载失败：", xhr.statusText);
    //     }
    //   };

    //   xhr.onerror = function () {
    //     console.error("下载失败");
    //   };
    //   xhr.setRequestHeader("token", `${token}`);
    //   xhr.send();
    // },
    // download(num) {
    //   console.log(num);
    //   let url = "";
    //   let name = "";
    //   if (num == 1) {
    //     url = this.FOne.url;
    //     name = this.FOne.name;
    //   }
    //   if (num == 2) {
    //     url = this.FTwo.url;
    //     name = this.FTwo.name;
    //   }
    //   if (num == 3) {
    //     url = this.FThree.url;
    //     name = this.FThree.name;
    //   }
    //   if (num == 4) {
    //     url = this.FFour.url;
    //     name = this.FFour.name;
    //   }
    //   if (num == 5) {
    //     url = this.FFive.url;
    //     name = this.FFive.name;
    //   } // 注意这里应该是 FFive 而不是重复使用 FFour
    //   // var xhr = new XMLHttpRequest();
    //   // "get",
    //   //   "/server-api/api/system/rest/s/apply/agree-document/get?userId=" +
    //   //     this.userId,
    //   //   true;

    //   // xhr
    //   //   .open("get", `/admin/common/download/?fileUrl=${url}`, {
    //   //     responseType: "blob", // 设置响应类型为 blob 来处理二进制数据
    //   //   })
    //   //   .then((response) => {
    //   //     //   console.log(response);
    //   //     //   const blob = new Blob([response.data], {
    //   //     //     type:
    //   //     //       response.headers["content-type"] || "application/octet-stream",
    //   //     //   });
    //   //     //   const link = document.createElement("a");
    //   //     //   link.href = URL.createObjectURL(blob);
    //   //     //   link.download = "downloaded_file"; // 设置默认文件名或根据实际情况动态设置文件名
    //   //     //   document.body.appendChild(link);
    //   //     //   link.click(); // 模拟点击链接以开始下载
    //   //     //   document.body.removeChild(link); // 移除临时的链接元素，避免内存泄漏
    //   //     // })
    //   //     // .catch((error) => {
    //   //     //   console.error("下载失败：", error);
    //   //     // });
    //   //     // 创建一个临时的链接元素来触发下载
    //   //     const blob = new Blob([response.data], { type: "application/pdf" });
    //   //     const link = document.createElement("a");
    //   //     link.href = URL.createObjectURL(blob);
    //   //     link.download = name; // 设置下载文件的名字
    //   //     document.body.appendChild(link);
    //   //     link.click(); // 模拟点击链接以开始下载
    //   //     document.body.removeChild(link); // 移除临时的链接元素
    //   //   })
    //   //   .catch((error) => {
    //   //     console.error("下载失败：", error);
    //   //   });
    //   const xhr = new XMLHttpRequest();
    //   xhr.open("get", `/admin/common/download/?fileUrl=${url}`, true);
    //   // const token =
    //   const token = localStorage.getItem("token");
    //   if (token) {
    //     xhr.setRequestHeader("token", `${token}`);
    //   }
    //   xhr.responseType = "blob"; // 设置响应类型为 blob 来处理二进制数据

    //   xhr.onload = function () {
    //     if (xhr.status === 200) {
    //       // 获取 Content-Disposition 头部信息，从中提取文件名
    //       const contentDisposition = xhr.getResponseHeader(
    //         "content-disposition"
    //       );
    //       let fileName = name; // 默认文件名
    //       if (contentDisposition) {
    //         const regex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;
    //         const matches = regex.exec(contentDisposition);
    //         if (matches != null && matches[1]) {
    //           fileName = matches[1].replace(/['"]/g, "");
    //         }
    //       }
    //       console.log("xhr.response", xhr.response);
    //       // // 创建 Blob 对象
    //       // const blob = new Blob([xhr.response], {
    //       //   type: xhr.getResponseHeader("Content-Type") || "application/pdf",
    //       // });
    //       // console.log(blob);
    //       // 创建一个临时的链接元素来触发下载
    //       const link = document.createElement("a");
    //       link.href = URL.createObjectURL(xhr.response);
    //       link.download = decodeURIComponent(fileName); // 设置下载文件的名字
    //       document.body.appendChild(link);
    //       link.click(); // 模拟点击链接以开始下载
    //       document.body.removeChild(link); // 移除临时的链接元素，避免内存泄漏
    //     } else {
    //       console.error("下载失败：", xhr.statusText);
    //     }
    //   };

    //   xhr.send();
    // },
    download(num) {
      this.loading = true;
      let url = "";
      let name = "";
      if (num == 1) {
        url = this.FOne.url;
        name = this.FOne.name;
      }
      if (num == 2) {
        url = this.FTwo.url;
        name = this.FTwo.name;
      }
      if (num == 3) {
        url = this.FThree.url;
        name = this.FThree.name;
      }
      if (num == 4) {
        url = this.FFour.url;
        name = this.FFour.name;
      }
      if (num == 5) {
        url = this.FFive.url;
        name = this.FFive.name;
      }
      http
        .get(`/admin/common/download`, {
          params: { fileUrl: url },
          responseType: "blob", // 重要：设置 `blob` 类型以处理二进制数据
        })
        .then((response) => {
          // 获取 `Content-Disposition` 头部信息（提取文件名）
          const contentDisposition = response.headers["content-disposition"];
          let fileName = name || "downloaded_file"; // 默认文件名
          if (contentDisposition) {
            const matches = contentDisposition.match(
              /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/
            );
            if (matches && matches[1]) {
              fileName = decodeURIComponent(matches[1].replace(/['"]/g, ""));
            }
          }

          // 创建 Blob 并触发下载
          const blob = new Blob([response.data], {
            type:
              response.headers["content-type"] || "application/octet-stream",
          });
          const link = document.createElement("a");
          link.href = URL.createObjectURL(blob);
          link.download = fileName;
          document.body.appendChild(link);
          this.loading = false;
          link.click();
          document.body.removeChild(link);
          URL.revokeObjectURL(link.href); // 释放内存
        })
        .catch((error) => {
          console.error("文件下载失败:", error);
        });
    },
    pdfDownload(num) {
      this.loading = true;
      let url = "";
      let name = "";
      if (num == 1) {
        url = this.FOne.url;
        name = this.FOne.name;
      }
      if (num == 2) {
        url = this.FTwo.url;
        name = this.FTwo.name;
      }
      if (num == 3) {
        url = this.FThree.url;
        name = this.FThree.name;
      }
      if (num == 4) {
        url = this.FFour.url;
        name = this.FFour.name;
      }
      if (num == 5) {
        url = this.FFive.url;
        name = this.FFive.name;
      }

      http
        .get(`/admin/common/download`, {
          params: { fileUrl: url },
          responseType: "blob", // 重要：设置 `blob` 类型以处理二进制数据
        })
        .then((response) => {
          // 获取 `Content-Disposition` 头部信息（提取文件名）
          const contentDisposition = response.headers["content-disposition"];
          let fileName = name || "downloaded_file"; // 默认文件名
          if (contentDisposition) {
            const matches = contentDisposition.match(
              /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/
            );
            if (matches && matches[1]) {
              fileName = decodeURIComponent(matches[1].replace(/['"]/g, ""));
            }
          }

          // 创建 Blob 并触发下载
          const blob = new Blob([response.data], {
            type:
              response.headers["content-type"] || "application/octet-stream",
          });
          const link = document.createElement("a");
          link.href = URL.createObjectURL(blob);
          link.download = fileName;
          document.body.appendChild(link);
          this.loading = false;
          link.click();
          document.body.removeChild(link);
          URL.revokeObjectURL(link.href); // 释放内存
        })
        .catch((error) => {
          console.error("文件下载失败:", error);
        });
    },
    selectother() {
      // const expertid = localStorage.getItem("expertid");
      const expertid = this.expertid;
      const usrid = localStorage.getItem("usrid");
      http
        .get(`/admin/expertOtherInfo/get/${expertid}`, {
          headers: {
            "Content-Type": "application/json",
          },
        })
        .then((response) => {
          console.log("other查询成功:", response.data.data);
          if (response.data.data.length != 0) {
            this.other = response.data.data;
            console.log(this.other);
          }
          // 转换 startDate 和 endDate 到 <el-date-picker> 可接受的格式
          // 可以在此处添加成功后的逻辑，如提示用户、重置表单等
        })
        .catch((error) => {
          console.error("提交失败:", error);
          // 错误处理逻辑
        });
    },
    selectpdf() {
      // // const expertid = localStorage.getItem("expertid");
      // const expertid = this.expertid;
      // http
      //   .get(`/admin/expertAttach/getName/${expertid}`, {
      //     headers: {
      //       "Content-Type": "application/json",
      //     },
      //   })
      //   .then((response) => {
      //     console.log("pdf查询成功:", response.data.data);
      //     // console.log(this.files);
      //     // this.files.applicationForm= response.data.data.applicationFormName
      //     // this.files.certificate= response.data.data.certificateName
      //     // this.files.idCard= response.data.data.idCardName
      //     // this.files.qualification= response.data.data.qualificationName
      //     // this.files.supportMater= response.data.data.supportMaterName
      //     // 创建一个空的File对象，指定文件名和MIME类型
      //     const emptyContent = new Uint8Array(0); // 创建一个长度为0的Uint8Array表示空内容
      //     const placeholderFile = new File([emptyContent], "filename.txt", {
      //       type: "application/octet-stream",
      //     });
      //     console.log("placeholderFile", placeholderFile);
      //     // this.files = {
      //     //   idCard: placeholderFile,
      //     //   certificate: placeholderFile,
      //     //   qualification: placeholderFile,
      //     //   supportMater: placeholderFile,
      //     //   applicationForm: placeholderFile,
      //     // }
      //     console.log(this.fileone);
      //     // console.log("applicationFormName", response.data.applicationFormName);
      //     if (response.data.data.idCardName) {
      //       const newone = {
      //         name: response.data.data.idCardName,
      //         url: "",
      //       };
      //       this.fileone = [newone];
      //     }
      //     if (response.data.data.certificateName) {
      //       const newone = {
      //         name: response.data.data.certificateName,
      //         url: "",
      //       };
      //       this.filetwo = [newone];
      //     }
      //     if (response.data.data.qualificationName) {
      //       const newone = {
      //         name: response.data.data.qualificationName,
      //         url: "",
      //       };
      //       this.filethree = [newone];
      //     }
      //     if (response.data.data.supportMaterName) {
      //       const newone = {
      //         name: response.data.data.supportMaterName,
      //         url: "",
      //       };
      //       this.filefour = [newone];
      //     }
      //     if (response.data.data.applicationFormName) {
      //       const newone = {
      //         name: response.data.data.applicationFormName,
      //         url: "",
      //       };
      //       this.filefive = [newone];
      //     }
      //     // this.files[1] = response.data.data[1]
      //     // this.files[2] = response.data.data[2]
      //     // this.files[3] = response.data.data[3]
      //     console.log(this.files);
      //     // if (response.data.data.length != 0) {
      //     //   this.other = response.data.data;
      //     // }
      //     // 转换 startDate 和 endDate 到 <el-date-picker> 可接受的格式
      //     // 可以在此处添加成功后的逻辑，如提示用户、重置表单等
      //   })
      //   .catch((error) => {
      //     console.error("提交失败:", error);
      //     // 错误处理逻辑
      //   });
      const usrid = localStorage.getItem("usrid");
      // (this.fileone = []),
      //   (this.filetwo = []),
      //   (this.filethree = []),
      //   (this.filefour = []),
      //   (this.filefive = []),
      //   (this.files = {
      //     idCard: null,
      //     certificate: null,
      //     qualification: null,
      //     supportMater: null,
      //     applicationForm: null,
      //   });
      // this.FFive = { name: "", url: "" };
      // this.FFour = { name: "", url: "" };
      // this.FThree = { name: "", url: "" };
      // this.FTwo = { name: "", url: "" };
      // this.FOne = { name: "", url: "" };
      const expertId = this.expertid;
      const id = localStorage.getItem("usrid");
      http
        .get(`/admin/expertAttach/get/${expertId}`)
        .then((response) => {
          // console.log("成功响应:", response.data);
          // console.log(response);
          // console.log("成功响应:", response.data);
          const idCard = response.data.data.idCard;
          const certificate = response.data.data.certificate;
          const qualification = response.data.data.qualification;
          const supportMater = response.data.data.supportMater;
          const applicationForm = response.data.data.applicationForm;
          // console.log("idCard", idCard);
          // console.log("certificate", certificate);
          // console.log("supportMater", supportMater);
          // console.log("qualification", qualification);
          // console.log("applicationForm", applicationForm);
          if (idCard) {
            http
              .get(`/admin/attachment/get/${idCard}`, {
                headers: {
                  "Content-Type": "multipart/form-data", // 注意：实际上不需要手动设置这个头部，浏览器会自动设置
                },
              })
              .then((response) => {
                console.log("idcard", response.data);
                this.FOne.name = response.data.fileName;
                this.FOne.url = response.data.address;

                // address
                // console.log(this.files.idCard);
                // this.files.idCard.
              })
              .catch((error) => {
                console.error("错误：", error);
              });
          }
          if (certificate) {
            http
              .get(`/admin/attachment/get/${certificate}`, {
                headers: {
                  "Content-Type": "multipart/form-data", // 注意：实际上不需要手动设置这个头部，浏览器会自动设置
                },
              })
              .then((response) => {
                console.log("certificate", response);
                this.FTwo.name = response.data.fileName;
                this.FTwo.url = response.data.address;
              })
              .catch((error) => {
                console.error("错误：", error);
              });
          }
          if (qualification) {
            http
              .get(`/admin/attachment/get/${qualification}`, {
                headers: {
                  "Content-Type": "multipart/form-data", // 注意：实际上不需要手动设置这个头部，浏览器会自动设置
                },
              })
              .then((response) => {
                console.log("qualification", response);
                this.FThree.name = response.data.fileName;
                this.FThree.url = response.data.address;
              })
              .catch((error) => {
                console.error("错误：", error);
              });
          }
          if (supportMater) {
            http
              .get(`/admin/attachment/get/${supportMater}`, {
                headers: {
                  "Content-Type": "multipart/form-data", // 注意：实际上不需要手动设置这个头部，浏览器会自动设置
                },
              })
              .then((response) => {
                console.log("qualification", response);
                this.FFour.name = response.data.fileName;
                this.FFour.url = response.data.address;
              })
              .catch((error) => {
                console.error("错误：", error);
              });
          }
          if (applicationForm) {
            http
              .get(`/admin/attachment/get/${applicationForm}`, {
                headers: {
                  "Content-Type": "multipart/form-data", // 注意：实际上不需要手动设置这个头部，浏览器会自动设置
                },
              })
              .then((response) => {
                console.log("applicationForm", response);
                this.FFive.name = response.data.fileName;
                console.log(this.FFive);
                this.FFive.url = response.data.address;
              })
              .catch((error) => {
                console.error("错误：", error);
              });
          }

          // Message.success("保存成功");
          // this.formLabelAlign = response.data.data;

          // 处理成功的响应
        })
        .catch((error) => {
          console.error("错误:", error);
          // 处理错误
        });
      // 处理成功的响应
    },
    // selectchange(num) {
    //   console.log(this.formLabelAlign.primaryMajor);
    //   console.log(this.formLabelAlign.secondMajor);
    //   console.log(this.formLabelAlign.thirdMajor);
    //   console.log(this.formLabelAlign.fourthMajor);
    //   console.log(this.formLabelAlign.fifthMajor);
    //   const majors = [
    //     this.formLabelAlign.primaryMajor,
    //     this.formLabelAlign.secondMajor,
    //     this.formLabelAlign.thirdMajor,
    //     this.formLabelAlign.fourthMajor,
    //     this.formLabelAlign.fifthMajor,
    //   ];

    //   // 使用一个数组来临时存储去除"其他"之后的专业列表
    //   let filteredMajors = [];

    //   majors.forEach((major) => {
    //     if (major !== "其他") {
    //       filteredMajors.push(major);
    //     }
    //   });
    //   const otherCount = majors.filter((major) => major === "其他").length;
    //   // 使用Set去除重复项并检查长度是否一致
    //   const uniqueMajors = new Set(filteredMajors);
    //   console.log(uniqueMajors.size);
    //   console.log(otherCount);
    //   if (uniqueMajors.size + otherCount != 5) {
    //     Message.error(`第n个专业有错误`);
    //     this.showmajorerror[num] = 1;
    //   } else {
    //     this.showmajorerror[num] = 0;
    //   }
    // },
    selectchange(num) {
      console.log(this.formLabelAlign.primaryMajor);
      console.log(this.formLabelAlign.secondMajor);
      console.log(this.formLabelAlign.thirdMajor);
      console.log(this.formLabelAlign.fourthMajor);
      console.log(this.formLabelAlign.fifthMajor);

      const majors = [
        this.formLabelAlign.primaryMajor,
        this.formLabelAlign.secondMajor,
        this.formLabelAlign.thirdMajor,
        this.formLabelAlign.fourthMajor,
        this.formLabelAlign.fifthMajor,
      ];
      console.log(majors);
      const result = majors.map((item) =>
        Array.isArray(item) ? item.join("/") : item
      );
      console.log(result);

      // 使用一个数组来临时存储去除"其他"之后的专业列表
      let filteredMajors = [];
      result.forEach((major) => {
        if (major !== "无") {
          filteredMajors.push(major);
        }
      });
      const otherCount = result.filter((major) => major === "无").length;
      // 使用Set去除重复项并检查长度是否一致
      const uniqueMajors = new Set(filteredMajors);

      // 首先重置所有的错误标记
      this.showmajorerror = [0, 0, 0, 0, 0];

      // 检查每一个专业是否重复，如果是，则设置对应的错误标记，同时忽略空字符串和"无"
      result.forEach((_, index) => {
        const currentMajor = result[index];
        // 如果当前专业是空字符串或"无"，则跳过检查
        if (
          currentMajor === null ||
          currentMajor === "无" ||
          currentMajor === ""
        ) {
          return;
        }

        if (
          result.filter((major) => major === currentMajor).length >
          1 + (currentMajor === "无" ? otherCount - 1 : 0)
        ) {
          this.showmajorerror[index] = 1;
          // Message.error(`第${index + 1}个专业有错误`);
        }
      });

      // 可选：如果需要在全部正确时进行某些操作，可以在此添加逻辑
      if (!this.showmajorerror.includes(1)) {
        // 所有专业均无重复
      }
    },
    showDatePicker(scope) {
      this.$set(this.isTillNow, scope.$index, false);
    },
    showDatePicker1(scope) {
      this.$set(this.isTillNow1, scope.$index, false);
    },
    onDateChange(scope) {
      if (scope.row.endDate) {
        this.$set(this.isTillNow, scope.$index, false);
      }
    },
    onDateChange1(scope) {
      if (scope.row.endDate) {
        this.$set(this.isTillNow1, scope.$index, false);
      }
    },
    getPickerOptions(row, index) {
      const vm = this; // 保存当前 Vue 实例的引用
      return {
        shortcuts: [
          {
            text: "至今",
            onClick(picker) {
              vm.$set(vm.isTillNow, index, true); // 更新状态为“至今”
              row.endDate = ""; // 清空当前行的 endDate
              picker.$emit("pick", ""); // 手动触发日期选择器的关闭
            },
          },
        ],
      };
    },
    getPickerOptions1(row, index) {
      const vm = this; // 保存当前 Vue 实例的引用
      return {
        shortcuts: [
          {
            text: "至今",
            onClick(picker) {
              vm.$set(vm.isTillNow1, index, true); // 更新状态为“至今”
              row.endDate = ""; // 清空当前行的 endDate
              picker.$emit("pick", ""); // 手动触发日期选择器的关闭
            },
          },
        ],
      };
    },
    getuser() {
      http
        .get(`/admin/expertBasic/getUser`, {
          headers: {
            "Content-Type": "application/json",
          },
        })
        .then((response) => {
          console.log("response", response.data.data);
          this.expertname = response.data.data.name;
          this.formLabelAlign.idCard = response.data.data.username;
          this.formLabelAlign.phone = response.data.data.phone;
          this.formLabelAlign.gender = response.data.data.sex;
          this.formLabelAlign.name = response.data.data.name;
          this.formLabelAlign.email = response.data.data.email;
          // email
          this.expertid = response.data.data.id;
          // this.sid=response.data.data.id;
          this.selectbasic();
          // this.FFive.name = response.data.fileName;
          // console.log(this.FFive);
          // this.FFive.url = response.data.address;
        })
        .catch((error) => {
          console.error("错误：", error);
        });
    },
    findanli(type) {
      switch (type) {
        case "idCard":
          const link = document.createElement("a");
          // 直接使用相对于根目录的路径
          link.href = "/idcard.pdf";
          link.download = "身份证上传案例.pdf"; // 下载时使用的文件名
          document.body.appendChild(link);
          link.click();
          document.body.removeChild(link);
          // console.log("idCard");
          break;
        case "certificate":
          const link1 = document.createElement("a");
          // 直接使用相对于根目录的路径
          link1.href = "/certificate.pdf";
          link1.download = "学历证书及技术职称上传案例.pdf"; // 下载时使用的文件名
          document.body.appendChild(link1);
          link1.click();
          document.body.removeChild(link1);
          break;
        case "qualification":
          const link2 = document.createElement("a");
          // 直接使用相对于根目录的路径
          link2.href = "/qualification.pdf";
          link2.download = "职业资格上传案例.pdf"; // 下载时使用的文件名
          document.body.appendChild(link2);
          link2.click();
          document.body.removeChild(link2);
          // console.log("qualification");
          break;
        case "supportMater":
          const link3 = document.createElement("a");
          // 直接使用相对于根目录的路径
          link3.href = "/supportMater.pdf";
          link3.download = "证明材料上传案例.pdf"; // 下载时使用的文件名
          document.body.appendChild(link3);
          link3.click();
          document.body.removeChild(link3);
          // console.log("supportMater");
          break;
        case "applicationForm":
          const link4 = document.createElement("a");
          // 直接使用相对于根目录的路径
          link4.href = "/applicationForm.pdf";
          link4.download = "专家入库申请表上传案例.pdf"; // 下载时使用的文件名
          document.body.appendChild(link4);
          link4.click();
          document.body.removeChild(link4);
          // console.log("applicationForm");
          break;
      }
    },
    gettoday(row) {
      console.log(row);
    },
  },
  mounted() {
    //  this.selectpdf()
  },
  created() {
    this.getuser();
    // this.tableData.forEach((_, index) => {
    //   this.$set(this.isTillNow, index, !this.tableData[index].endDate);
    // });
    // this.tableData1.forEach((_, index) => {
    //   this.$set(this.isTillNow1, index, !this.tableData1[index].endDate);
    // });
  },
  // created() {
  //   // 初始化 isTillNow 数组，确保每个数据项都有对应的 till now 状态
  //   this.tableData.forEach((_, index) => {
  //     this.$set(this.isTillNow, index, !this.tableData[index].endDate);
  //   });
  // }
};
</script>
<style scoped lang="less">
.form-container-top {
  position: absolute;
  width: 100%;
  height: 60px;
  background-color: #fff;
  padding: 32px 24px;
  /* font-size: 18px; */
  font-family: inherit;
  color: #212121;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
  border-radius: 10px;
  box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.084), 0px 2px 3px rgba(0, 0, 0, 0.168);
}

.information-form {
  padding: 20px;
  padding-top: 0;
  background-color: #f4f4f4;
}

.header {
  display: flex;
  justify-content: space-between;
  background-color: #1e74b9;
  color: white;
  padding: 10px;
  border-radius: 5px;
  font-size: 1.3vw;
  align-items: center;

  /* 垂直居中 */
  span {
    margin-left: 1%;
  }
}

.down {
  width: 90%;
  height: 100%;
  position: relative;
  z-index: 1;
  margin-left: 5%;
}

.flag {
  width: 20%;
  height: 10%;
  position: absolute;
  margin-top: 1%;
  margin-left: 75%;
  z-index: 2;
  color: red;
  font-size: 1.2vw;
}

.basic {
  width: 100%;
  height: 100%;

  .el-select {
    width: 70%;
  }

  .one {
    margin-bottom: 1%;

    .one-top {
      background: #1e74b9;
      padding-left: 1%;
      padding-top: 0.8%;
      padding-bottom: 0.8%;
      color: white;
    }

    .one-down {
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: row;
      margin-top: 2%;
    }

    .left {
      width: 10%;
      height: 100%;
      margin-left: 1%;
      margin-right: 1%;

      .avatar-uploader-icon {
        font-size: 28px;
        color: #8c939d;
        width: 9vw;
        height: 12vw;
        line-height: 12vw;
        text-align: center;
      }

      .avatar {
        width: 9vw;
        height: 12vw;
        display: block;
      }

      .avatar-uploader .el-upload {
        border: 1px dashed #d9d9d9;
        border-radius: 6px;
        cursor: pointer;
        position: relative;
        overflow: hidden;
      }

      .avatar-uploader .el-upload:hover {
        border-color: #409eff;
      }

      div {
        font-size: 0.7vw;
        text-align: center;
        color: black;
        line-height: 1.5;

        span {
          font-size: 1vw;
        }
      }
    }

    .right {
      width: 85%;
      height: 100%;
      margin-left: 2%;

      .rightline {
        height: 5.5vh;
        width: 100%;
        margin-bottom: 1.5%;
        line-height: 5.5vh;
        font-size: 1vw;
        display: flex;
        justify-content: space-between;
        .bankname {
          width: 70%;
          height: 100%;
        }
        .el-input {
          width: 65%;
          height: 100%;
        }

        ::v-deep .el-form-item__label {
          font-size: 1vw;
          min-width: 4.5vw;
        }

        span {
          width: 20%;
          height: 100%;
          display: inline-block;
        }
      }
    }
  }
}

.secondline {
  height: 5.5vh;
  width: 100%;
  margin-bottom: 1.5%;
  line-height: 5.5vh;
  font-size: 1vw;
  display: flex;
  justify-content: space-between;
  flex-direction: row;
  color: black;

  span {
    width: 25%;
    height: 100%;
    display: inline-block;
  }

  // .el-option {
  //     width: 80%;
  // }

  // .secondleft {
  //   width: 25%;

  //   span {
  //     width: 36%;
  //     height: 100%;
  //     display: inline-block;
  //   }

  //   .el-select {
  //     margin-left: 2%;
  //     width: 55%;
  //   }
  // }

  .secondright {
    width: 100%;
    // background: orange;
    span {
      width: 19%;
      // background: red;
      .el-select {
        width: 50%;
      }
    }
  }

  .el-input {
    width: 70%;
    height: 100%;
  }

  ::v-deep .el-form-item__label {
    font-size: 1vw;
    min-width: 4.5vw;
  }
}

.el-tabs__item {
  font-size: 1.5vw;
}

.tabscard {
  color: #1e74b9;
  font-size: 1.2vw;
  margin-top: 1%;
  position: relative;
}

::v-deep .tabscard .el-tabs__item {
  color: #333;
  font-size: 1.2vw;
  height: 7vh;
  line-height: 7vh;
}

.form-section {
  margin-bottom: 20px;
  background-color: white;
  padding: 15px;
  border-radius: 5px;
}

.form-row {
  margin-bottom: 10px;
}

.form-row label {
  width: 150px;
  display: inline-block;
}

.form-row input,
.form-row select {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

button {
  padding: 10px 20px;
  background-color: #1e74b9;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background-color: #155f8a;
}

.exit-btn {
  font-size: 1.3vw;
}

.el-row {
  margin-bottom: 20px;

  &:last-child {
    margin-bottom: 0;
  }
}

.el-col {
  border-radius: 4px;
}

.bg-purple-dark {
  background: #99a9bf;
}

.bg-purple {
  background: #d3dce6;
}

.bg-purple-light {
  background: #e5e9f2;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}

.downn {
  margin-top: 1%;
  color: black;
  font-size: 2vw;
  width: 100%;
  height: 100%;

  div {
    height: 25%;
    margin-bottom: 1%;
    // padding-left: 1%;
    display: flex;
    flex-direction: row;

    span {
      display: inline-block;
      width: 32%;
      height: 100%;
    }
  }

  .uploads {
    display: flex;
    flex-direction: row;
    width: 40%;
  }
}
.downother {
  width: 100%;
  height: 100%;
  // background: yellow;
  display: flex; /* 启用 Flexbox 布局 */
  flex-direction: row;
}
.downothers1 {
  width: 100%;
  height: 100%;
  margin-left: 1%;
  // background: yellow;
  display: flex; /* 启用 Flexbox 布局 */
}
.downother > .el-form-item {
  flex-grow: 1; /* 让每个表单项都均匀扩展 */
  margin: 5px; /* 可选：给每个表单项之间添加一些间距 */
  min-width: 0; /* 确保即使内容超出也能收缩 */
}

/* 如果需要更精确地控制标签和输入框的布局 */
.downother .el-form-item__content {
  flex-grow: 1;
  display: flex;
  align-items: center; /* 垂直居中对齐 */
}
/* 自定义标签宽度 */
::v-deep.downother .el-form-item__label {
  // width: 320px !important; /* 强制设置标签宽度 */
  font-size: 1vw;
}
/* 自定义标签宽度 */
::v-deep.downother1 .el-form-item__label {
  // width: 320px !important; /* 强制设置标签宽度 */
  font-size: 1vw;
}
.adv {
    position: sticky;
    display: block;
    top: 0;
    width: 100%;
    height: 5.0vh;
    background-color: rgba(41, 128, 185, 0.7);
    z-index: 1000;
    font-size: 1.3vw;
    line-height: 50px;
    text-align: center;
    color: #fff;
    a {
      text-decoration: underline;
    }
  }
</style>